Sql*Perl Plus, E Editor, and JFM File Manager for Linux and Windows, Oh My!

(Finally) Announcing the official release of three of my all-time favorite Perl/Tk applications in both Linux and Windows versions!  These three programs are like old friends to me since I wrote them years ago and have been using them both on and off the job and improving them for years now.  They have made my work much easier and now I’ve finally had the time to actually get them ready for use by others.  They are:  “Sql*Perl Plus” – an all-purpose “Swiss Army knife” database manipulation and report-generating tool; “E Editor” – an all-purpose full-screen, full-color context-highlighting text and code editor and viewer; and JFM4 Filemanager – an all-in-one file-manager, application launcher, shell, and *FTP client for managing files, launching applications and shell commands with many unique features.  I wrote all three of these tools to improve my daily workflow and meet specific needs that were not being fully and efficiently met by other tools available to me at the time, and when I found myself just needing “something extra and unique”, and, because I could! :D They each allowed me to hone my programming skills in different ways and learn new techniques.
Each started out as something relatively simple, designed to meet a need, but all quickly mushroomed into much larger and more capable tools as needs arose and changed.  The most liberating thing about writing and using them is that I know that whenever I think up a new need, use, or feature, I can add it.  I have decided to finally bundle each up in both a Linux/Unix tarball and create an easy-to-run Windows installable executable (using the very handy and free Inno Setup Wizard), along with all the requisite bugfixes, touchups, tweaks, and documentation polishing, in the hope that others may find one or more of them useful.  They are all fully open-source and released under the GNU public license, though I retain all copyright to the source code.  You are free to use and modify the code as permitted under that license.  However, I make no warrantees explicit or implied, thus you use this code solely at your own risk. You can download these and other open-source software I’ve created here at my software download page and / or on my CPAN page.
Sql*Perl Plus is the oldest of the three having just turned 20 this month.  It started out as a work request to make an in-house multi-database GUI tool similar to Oracle’s Sql*Plus(tm) tool.  The goal was to create SQL queries and simple reports using a GUI tool and a mouse to save a lot of typing.  Later, I added the ability to create formatted reports, and even M$-Excel spreadsheets which lead me to create the String::PictureFormat CPAN module.  I also added the ability to query database tables and generate M$-Excel spreadsheets, XML-formatted output, and DBD::Sprite tables.  This led to creating the ability to load database tables with data from M$-Excel spreadsheets as well.  Later still came the ability to auto-generate Perl scripts from queries both for batch-loading data into tables (the generated scripts can be used repeatedly as scheduled batch jobs), and for repeatedly generating reports on a scheduled basis or as-needed.  The tool can aid greatly in the creation of just the right query and formatting template for whatever the input data format is expected to be and / or the desired report layout.
E Editor provides a full-featured, but simple to use desktop application development environment, particularly for Perl development as it provides optional language-specific code syntax highlighting for dozens of different languages and markup, easy search and replace including via Perl regular expressions, a one-button Perl compile / syntax check feature and the ability to highlight code snippets and apply Perl’s eval() function to it.  There’s also named bookmarking, auto-backup on startup capability, quick temporary backup capability, Perl, C, and HTML structure insertion, reformatting, indenting, tab or space indents, choice of wrapping, fonts, colors, tagging, split-screen, and multi-tab/open files, custom configuration, etc.  Using a simple symlink, a “read-only” “viewer” version can be created in Linux/Unix using the same program executable.  I created “E” after moving from the DOS world to Linux/Unix back in the mid ’90s and having to give up my trusty full-featured, full-color “shareware” DOS editor “PC-Write“(tm) for the cryptic over-nerdy “vi” of Unix.
JFM4 is much more recent.  This started out with me wanting a graphical Norton Commander-ish filemanager with split-screen capability for easily copying and moving files about with options for more than one application-association with given file types / extensions (including directories), an enhanced command-line and command-repeat for quick shell commands (like I had on DOS with my handy “WinDOS Executive” (named after the old Windows MS-Dos Executive) I wrote for MS-DOS for the same reasons back in the ’80s.  The “something extras” I wanted was the aformentioned multi-app file assocation via a right-click popup menu (most filemanagers only offer one per file type, and with us Perl-ers are so used to “there being more than one way”), including a default (double-click) action, a separate “multi-file” association popup menu for invoking programs that can take multiple files at once / or loop to apply a program / command to all selected files, and a similar association menu for directories too that can invoke your choice of programs that can open entire directories at once like Audacious(tm).  It also has an “Action menu” of frequently-applied actions that can be performed on selected files, or just stand-alone, such as mounting frequently-used filesystems.  Another unique feature in the Action menu is one can have commands like “diff” gui-tools that can take two files, say, for comparisen.  I can select a file from the top panel and one from the bottom, select “tkdiff” from the action menu, and quickly compare the two files.  I can also craft shell commands with parameter placeholders and select files to process with the parameters being replaced with the selected and matching files in a loop.  It saves all typed-in commands, along with frequently-visited directories, and remote-host connections for quick, one-click reactivation.  There’s even a custom drop-down menu and text field to enter custom file-selection groupings, such as “Music”, “Perl”, etc.; and Perl regular-expression patterns for reducing the list of files shown in the file panels. There’s also multiple-tabs for having more than two directories and / or remote-connections open at once.  It also uses my “Net::xFTP” module to allow mounting file-systems on remote hosts as if they were local, allowing nearly all these features to be performed on remote files too!  This obsoleted another program I had previously written as a GUI wrapper to Net::xFTP called Ptkftp.  Later, to add a little eye-candy, I created the CPAN module “Tk::HMListbox” to allow for a column of tiny file-type icons to be displayed next to each file and directory.  While JFM4 does work on a limited basis on Windows and I’n not hesitant to use it on those rare occasions that I’m forced to work (“with one hand tied behind my back”) on Windows, it’s really designed to be a Linux/Unix tool, but it also comes with the install wizard for Windows.  It still could use some more work, features, and testing on that platform, however.

“JFM File Manager” screenshot; Feb. 3, 2016;  image by (©:2016) me.

“E Editor” screenshot; Feb. 3, 2016;  image by (©:2016) me.

“Sql*Perl Plus” screenshot; Feb. 3, 2016;  image by (©:2016) me.

My Current Linux Desktop

My Linux Desktop“; Jan 22, 2016;  image by (©:2016) me.
For those of you who are curious as to what my desktop looks like, this is it.  I posted this to Flickr the other day as my entry in response to an article on Lifehacker inviting people to share their Linux desktops.  As you can see, it’s somewhat “old-school” looking, since my computer (Dell Latitude D620 laptop) is somewhat old and limited in it’s power and speed.  I use the ancient Afterstep window-manager, which is fairly lean and mean, compared to “modern” desktops such as KDE and Gnome, which are absolute hogs on this hardware!  I’ve looked into switching into one of the more modern lean window-managers, such as Fluxbox, Xfce, or Icewm, but I’m used to Afterstep and would have to give up some of the features it offers.  Afterstep has a few annoying bugs / quirks, but the two reasons I stick with it are:  1)  It has “Wharf”, a Window-Maker-based launcher app. that not only provides for launch buttons, but can also “swallow” Window-maker “dock-apps”.  I wrote a dock-app years ago called “TkWeather” that can scrape three different weather sites and provide current weather info. dynamically in an icon that can be clicked on to see more information or double-clicked to pull up the full weather website.  I tried to get it to run in Fluxbox’s “slit”, but have been unable to do so.  2)  Afterstep requires modifying some text-based configuration files, but I’ve already long ago mastered how to configure Afterstep to look exactly the way I want it, and it would be a steep learning curve to have to re-configure everything the way I like it in another window-manager!  Afterstep gives me everything I want and nothing I don’t.  You can see the “wharf” (vertical row of icons) on the right.  The top button that’s grimacing will pop up an additional row of lesser-used program launch buttons.  The currently running (swallowed) dock-apps are (from top to bottom):  wmitime (clock), (my) TkWeather, wmtemp (cpu tempertures), xload (memory), wmappl (list of many more small icons that can launch apps.), wmMoonClock, and Pager.  The others are just launch button icons for terminal, browser, editors, etc.
As a career programmer, specializing in Perl and Tk, I’ve written some of the applications / tools I use regularly and hacked others.  I guess I’m a control freak and when I have to work with a tool on a daily basis to get work done.  I quickly become aware of how I want it to work to maximize my workflow and I see the shortcomings in whatever I’m using, then search for one that will do what I want to do.  It Seems that in some cases I’ve been unable to find what I’m looking for, so I’ve then written my own.  This was the case with my code editor (E) and file manager (jfm4) (both shown on this desktop image) as well as the weather app (TkWeather).  By writing a tool myself, I control exactly what it does (and doesn’t do), and can adapt it over time to meet changing requirements.  I did not write Fauxdacious, but over the years, I have hacked my favorate all-purpouse audio media player (Audacious) to work better in my environment.  I finally bundled and released all my Audacious hacks together as “Fauxdacious” after adding a VIDEO-playing capability!  As far as themeing goes, Afterstep now supports themes, but I’ve never bothered to bundle the config. files I’ve modified and all the images for release as new “themes”.  I’ve created a few different “theme” configurations that I can switch between when I get tired of one.  With Afterstep, I’ve mastered customizing (the titlebar, the buttons on the titlebar along with their functions) as Afterstep permits you to specify exactly how everything looks.  Then I’ve found themes for Firefox and skins for Fauxdacious/Audacious that closly match.  My favorite color is violet and this is reflected in this desktop.  I used the “Lavafox” theme for Firefox and then created a new “skin” for Fauxdacious/Audacious that I call “Lavadacious” to somewhat match that.  For my Perl/Tk programs, I simiply added “*tkPalette: #160028” and “*tkVpalette: #160028” to my .Xdefaults file.  You can download “Fauxdacious”, “Lavadacious”, “TkWeather”, and many of my other open-source software here at my download site!

Four new Perl modules released to CPAN

Four new Perl modules released to CPAN
I’m pleased to announce the recent release of four (4) shiny new Perl modules to CPANString::Pictureformat, Date::Fmtstr2time, Date::Time2fmtstr, and JDBIx (pronounced “Jaydeebix”).  All four either are or are derived from existing work I’ve done and have been using over the years, but had just never gotten around to fully documenting and testing them to get them in a condition fit for “prime time” release for public consumption.  This included creating proper documentation and test harnesses for each.  The first three modules involve string manipulation functions based on a formatting “mask” string.  JDBIx is a higher-level database manipulation module that makes short work of fetching, inserting, and updating vectors of data by providing a higher level interface to Perl’s fine all-purpose DBI (Database Interface) module.  This has kept me very busy of late documenting, creating test harnesses that satisify the CPAN Testers, fixing a few bugs that affected parts that I rarely used, and even adding a few new features to polish ’em up a bit.  It’s been rather entertaining for me going through some of this “old” code that I wrote years ago.  Some of it is over fifteen years old!  Fortunately for me, I apparently wrote fairly good code then, or at least have gradually cleaned some of it up and documented in fits and starts over the years as I needed it for new jobs and clients along the way.  Anyway, I finally decided to clean ’em all up and make them public (via CPAN), with the side benefit to me of being able to easily install them on new systems via CPAN’s installer the same way most other modules are installed.
This started out as a simple project to get String::Pictureformat to better format dates when using Sql*Perl Plus, another (now massive) “Swiss Army knife” tool I wrote nearly twenty years ago and repeatedly expanded to include new features for various clients and jobs I’ve had over the years.  I decided to get String::Pictureformat cleaned up, and added new date/time handling capabilities and make it public.  However, for dates, it needed two other older functions I had written for DBD::Sprite years ago which were not modular.  So, I decided to make modules out of those two functions, leading to Date::Fmtstr2time and Date::Time2fmtstr!  Now I was on a roll, so I then decided to clean up JDBIx too.  So, what started out as a small project has morphed into a huge undertaking and has taken over a month to complete.
The problem I’ve discovered over the course of the last month or so doing this is a trap that it’s rather easy as a Perl programmer to fall into that’s to some degree related to the Perl philosophy of “there are many ways to do something”.  Wnen I started out writing a module years ago, I would write it to do “this” (a specific thing).  Whilst coding, I’d realize that it was extremely easy to also make it do “this” and “that” too.  I would immediately deploy the module (tool) so I could do “this” regularly and very efficiently.  I’ve continued using the module to do “this” and occasionally “that” over the years without fuss.  A new client would come along and I’d realize that it could and should easily do “the other thing” too.  Sometimes I was fairly good at including decent comments in the code, and even added POD documentation to help me remember the tricky parts.  Now as I attempt to document all the functions and their options, I discover that the module not only does “this”, “that”, and “the other thing”, but I also had coded it to do “this”, “this”, “this”, and “even this” too, but these other rarely or ever used features also contain a few bugs.  As you can see, this made the documentation and testing work much more complicated and time consuming!  Fortunately, the end result is worth it as now I have a module that does this, this, this, even this, that, and the other thing well, is documented for easy lookup, is easily installable from anywhere with an internet connection, will play nice with other modules and programs, and is now freely available for others to avail themselves!
Here are the four modules and their abstracts:

  • String::Pictureformat – Functions to format and unformat strings based on a “Picture” (mask) format string.  Provides format and unformat functions that, given a string of data and a special mask string, will return a string formatted / justified / padded / etc. based on the mask string.  It includes the ability to format dollar values with floating dollar signs, decimals, accounting notation, etc.  It also includes the ability to round to a certain decimal place, and now the ability to format dates and times to desired layouts, word or character wrap long sentence strings, etc.  I originally wrote this for producing much more humanly-readable reports via Sql*Perl Plus.
  • Date::Fmtstr2time – Functions to format and unformat date/time strings into a Perl “Time” integer based on a “Picture” format (mask) string.  This was originally written to add the Oracle(tm) “TO_DATE()” function to my DBD::Sprite flat-file Oracle-simulation module.  It is now used (if installed) by String::Pictureformat for format date / time strings into Unix/Perl “Time” integers.
  • Date::Time2fmtstr – Functions to format and unformat Unix/Perl “Time” integers to strings based on a “Picture” format string.  This was originally written to add the Oracle(tm) “TO_CHAR()” function to my DBD::Sprite flat-file Oracle-simulation module.  It is now used (if installed) by String::Pictureformat for format Unix/Perl “time” integers into pretty, humanly-readable formats as desired.
  • JDBIx – Object-oriented higher-level DBI interface for select into arrays, placeholders, sequences, etc.  This began as a package of a few handy functions to make life developing database-driven programs and websites with Perl’s DBI module much simpler and straight forward by providing simple, one-line functions that could do “select” queries into vector arrays corresponding to columns of data in tables, and take similar vectors of data and insert or update database tables accordingly.  Instead of having to do “prepare()”, “execute()”, “bind()”, “fetch()”, cursors, loops, etc.  Single function calls can handle most “select”, “insert”s, “update”s, and “delete”s in database tables!  I called this package “DBIx” (DBI EXtra), but it was non-modular, having originally been written on the job using Perl 4 and “Oraperl” back in the nineties.  JDBIx combined all this into a modular, object-oriented format permitting multiple databases to be opened and manipulated at once.  I’ve been using JDBIx for several years on some of my own projects and websites, but had never documented it’s functions properly.

Running of the Bulls, by (© 2016) me.
"Running of the Bulls", by (© 2016) me.
This has been somewhat easy since that the holidays are over and the weather’s been cold, and I haven’t wanted to venture outside that much lately.  One of the advantages of Texas Winters is that we do get “breaks” every week or so with a nice cool, but pleasant sunny day randomly thrown in every now and then.  I’ve taken advantage of these lately too, going out with a buddy or two and taking some photos!  Last week, we went Northwest up to Wichita Falls, and stopped in Windthorst, Perrin, Archer City, and a few road-side stops in between.  On another day three of us went and took photos at the Fort Worth Stockyards, including the abandoned Swift meat-packing plant, and the “Running of the Bulls” (a daily longhorn cattle-drive down one of downtown Fort Worth’s major streets) for tourists.  This photo at left shows one of the bulls briefly straying off the street onto the sidewalk.  He appears to have a “bulls eye” on me but quickly rejoins the herd.  Probably just bored and wanted to do something a little different!  Please visit my Flickr site these and other photos.

Fauxdacious(tm) Media Player for Linux Released

UPDATE (12/13):  Version 3.7-beta2 Released, see download link and updated comments below:
I’m pleased to announce the initial release of Fauxdacious(tm) Media Player, v.3.7-beta1!  Fauxdacious is my recent FORK of “Audacious“.   The reason for this fork is that I’ve accumulated numerous changes (hacks) that I’ve made over the years to Audacious.   While I’ve submitted the patches of most of my enhancements to the Audacious team for mainline inclusion, they’ve rejected most and completely redid one in a way that I felt limited it’s usefulness.   The final straw came last month when I rewrote their FFMpeg plugin to support an option to display the video portion of media that contains video and they rejected it out of hand.   I was initially pretty perturbed with them because I believe this enhancement is a very useful addition and I started to get the impression that they really aren’t interested in code contributions from outside parties and started to write a rather angry screed here to my dear readers, but after further contemplation, I have concluded that it’s not warranted nor helpful to anyone.
I think the problem is that Audacious is a very mature (and very good, I might add) software project and therefore they are more limited in what they can and should change, and that their perceived “not invented here” attitude may be necessary at this point to maintain it’s integrity.   By forking, I can be more open to new ideas and features, which can potentially take it in new directions.  It should be remembered that Audacious itself was originally a fork of the now defunct XMMS media player!   I plan to continue offering further patches and changes I make to Fauxdacious available to the Audacious team for their consideration, but will no longer be concerned about whether they choose to include them.   I can also therefore be more open to new patches offered by others, which the Audacious team may reject, as well as cherry-picking new bugfixes, upgrades, and features that they include into their future releases.
Please be advised that though I’ve been a computer programmer for over thirty years, my C++ skills are very limited and Audacious is huge and very complex, so my ability to support and fix bugs is somewhat limited.   Therefore, if you have an issue with Fauxdacious, your best bet would be to first check their forums, then try real Audacious.   You need to determine if it fails there also, or if the issue only affects Fauxdacious!   If Audacious replicates the bug, then report it there, but if not, then notify me (as it is then an issue with my Fauxdacious patches), and I need to fix it!   Please DO NOT file bugs with Audacious regarding this project unless you can replicate it there without notifying me first!   This will be non-trivial, since it is not possible to my knowledge to install both Fauxdacious and Audacious on the same system at the same time.   By installing one, you will overwrite parts of the other, but you should still be able to switch between the two!
Fauxdacious Features not currently found in Audacious:
1)   A “visualization” option for displaying the video of ffmpeg files and streams that contain a video stream in a popup window.   Since Audacious already has “visualization” plugins that pop up a separate window to display stuff like fractals, equalizer graphs, etc. that are tied to what’s playing, my original idea was to create a “visualization” plugin that would display the actual video part of the stream, if it contained one.   I ended up rewriting their “FFaudio” plugin to add options for handling video and, so far, it handles any video stream that ffmpeg / ffplay can play! (See my previous post for history / details on how it works)  Screenshot below with my new “Lavadacious” skin (included):
2)  Restoration of XMMS’s “auto-preset” feature that permits creation of song/stream specific equalizer settings.  In the equalizer window (when using the WinAmp Skin interface, the [Auto] and [Preset] buttons now work again)!  When you “Export” a “Preset” file, the window pops up with the name of the currently-playing song displayed as the default file name and the default directory is the Audacious config directory.  If you save your preset file there under that name and you turn the [Auto] button on, and restart the song, Fauxdacious will load the matching preset file from there for that song/stream while it is playing, then restore the default equalizer presets when advancing to another song.  The [Preset] button also lights up if Fauxdacious is currently using a song/stream specific preset.  NOTE:  The Audacious team is currently working on a similar capability at my request, and I am likely to replace this with theirs when they do!
3)   The ability to toggle the recently-added Audacious record / dub option via it’s “audtool” DBus-based command-line tool permitting creation of quicker one-button desktop launcher activation, or even script activation of dubbing, ie. using Cron to record your favorite late-night radio show!  NOTE:  The Audacious team has merged this patch in their latest GIT at my request!
4)   Filewriter option to automatically deactivate equalizer and all effects plugins when recording so they’re not doubled down on during playback.  NOTE:  This has been replaced (in Fauxdacious v. 3.7-beta2) with the Audacious team’s latest GIT patch (after my request) which is better!
5)   Option to divert audio output to stdout in the user’s choice of selected audio formats for further processing by another program.  This is a rejected feature added to Audacious’s “FileWriter” plugin.  The idea here is to be able to use Fauxdacious as an audio component in pipes.  It also permits continuous recording across multiple files / tracks into a single stream.
6)   Better (imho) stdin input (for streaming) of most formats as well as playlists.   Again this is for using Fauxdacious as a component in pipes.   I use this sometimes in combination with “youtube-dl” to quickly download and stream Youtube videos without saving the download to a file.   Audacious actually implemented this at my urging a while back, but my rejected patch not only permits streaming media through stdin, but also lists of media files to process via simple ls commands, etc.  ie. generated by a script, etc.   Audacious now supports this via a slightly more complicated syntax, however. For a simple example:
ls ~/Music/*Swift*.mp3 | fauxdacious -Dc -
Also, Here’s my script for instant-play of youtube videos via Fauxdacious:
youtube-dl --no-continue --no-playlist --no-cache-dir --no-progress --no-call-home --youtube-skip-dash-manifest --prefer-ffmpeg -q -f mp4 --no-part $1 -o - 2>/dev/null | fauxdacious -Dq stdin://-.mp4
7)   New option (-P) to use the Pause button to simply mute (ie. commercials) while stream continues to play, allowing you to listen to something else in another instance (see feature 10 below).  I often keep two instances open while listening to online commercial radio streams (which are in commercial for nearly half the time anyway with typically 5-6 minute breaks).  I have the other instance playing my own (legally) downloaded music without the Pause-Mute option, and with one button-click, can switch to and resume my music where it left off while the commercials (in the first instance) blather on (muted) to the bit bucket! :D  Otherwise, one must either pause the radio stream, and resume where it left off (at the beginning of the commercial break) or mute the system’s speakers preventing the playing of anything else!
8)   Command line option “-D” – Delete all playlists.  Audacious added multiple playlists via tabs in their GTK/Qt interfaces which is quite nice, but could never get used to it as I only use the classic WinAmp skin interface which only supports (displays) a single playlist.  When starting Audacious with a new file or list of files, by default, it creates a new playlist, leaving all the others intact and invisible to you, which becomes annoying.  By starting Fauxdacious with “-D”, any existing playlists are deleted for you.  A second new option “-c” clears all entries from the current playlist.  by starting up with “-Dc”, you are guarenteed to start up with a clean slate containing only items listed as arguments.  If you start it with no arguments, you start up with a clean, empty playlist!
9)   New “-z” option to start up without the equalizer on.
10)   New “-n” option to activate a new “instance” of Fauxdacious by specifying an alternate config file name.  I use this, as described in the script below with two separate instances of Fauxdacious running at the same time with different playlists (and / or different configurations).  The default config file is named “config” (~/.config/audacious/config).  a new, separate “instance” is specified by “–new=newconfig” where “newconfig” is the name of a different config file (can be a copy).  This “name” can then be used in the “audtool” command to specify which instance of Fauxdacious to manipulate!  If just -n is given, just a new instance is created, but the default config file is used and it can not be manipulated with audtool.  The default config file is “config” and the default instance name is “audacious”.
Here’s my script for toggling between music and radio (and adjust the volume difference between the radio and my music) in two separate instances of Fauxdacious (the 2nd called “radio”) activated by a desktop launcher button:
audStatus=`cat /tmp/audstatus`
if [ "X$audStatus" = "X1" ]; then
audtool instance radio playback-pause set-volume -12
audtool playback-play
echo "2" >/tmp/audstatus
audtool playback-stop
audtool instance radio playback-play set-volume +12
echo "1" >/tmp/audstatus
11)  Additional skins, namely my very own “Lavadacious”, which I designed to match the violet “Lavafox” theme I use in Firefox and in my current desktop theme.  There is also a “DefaultRed” skin based on the Audacious “Default” skin, and additional flavors of the “Refugee” skin.
The Audacious team leader told me that it was not worth my effort (or theirs) to add video capability to Audacious since there are many excellent video players out there, but I disagree.  Sure, there are (I like VLC and Mplayer myself), but I really like the Audacious interface, and am spoiled used to it!  I also like to use Audacious’s sound-enhancing effects plugins while listening to audio or video! I admit I probably use my audio player a bit different than most.  I’m sortta a Linux command-line and scripting kinda guy and that’s what most of these hacks are for.  If you are too and / or like being able to watch videos while using Audacious’s wonderful audio-enhancing plugins, features, and beautiful classic WinAmp skins, then Fauxdacious is definitely for you!
Ok, so how do you get Fauxdacious?!
DISCLAIMER:   First of all, before downloading and installing Fauxdacious, please be aware that I consider this “beta”-quality software and therefore likely to contain a few bugs.  Therefore, I provide you this software “as-is” and I assume no liability for any damages resulting from it’s installation and use.  By using this software, you acknowledge that you are assuming all risk of any damages or injury that may result from such use!
1)   Uninstall libaudcore, audacious, and audacious-plugins from your system (if you are currently using Audacious).   This shouldn’t remove your Audacious configurations, but you should copy your ~/.config/audacious/* files somewhere else first, just in case something goes wrong!
2)   If you already have a fairly up-to-date version of Audacious running, you probably already have the dependencies installed.  If not, here’s a list.  Note, most of these aren’t required to actually get Fauxdacious (or Audacious) to run, but many are needed for particular plugins in order to process different types of media.
Depends: libasound2
Depends: libatk1.0-0
Depends: libaudcore3
Depends: libavcodec56
Depends: libavformat56
Depends: libavutil54
Depends: libbs2b0
Depends: libc6
Depends: libcairo2
Depends: libcddb2
Depends: libcdio-cdda1
Depends: libcdio13
Depends: libcue1
Depends: libcurl3-gnutls
Depends: libdbus-1-3
Depends: libdbus-glib-1-2
Depends: libfaad2
Depends: libflac8
Depends: libfluidsynth1
Depends: libfontconfig1
Depends: libfreetype6
Depends: libgcc1
Depends: libgdk-pixbuf2.0-0
Depends: libgl1-mesa-glx
Depends: libgl1-mesa-glx
Depends: libglib2.0-0
Depends: libgtk2.0-0
Depends: libjack-jackd2-0
Depends: libjack-jackd2-0 libjack0
Depends: liblircclient0
Depends: libmms0
Depends: libmodplug1
Depends: libmp3lame0
Depends: libmpg123-0
Depends: libneon27-gnutls
Depends: libnotify4
Depends: libogg0
Depends: libpango-1.0-0
Depends: libpangocairo-1.0-0
Depends: libpangoft2-1.0-0
Depends: libpulse0
Depends: libsamplerate0
Depends: libsdl2-2.0-0
Depends: libsidplayfp4
Depends: libsndfile1
Depends: libsndio6.0
Depends: libsoxr0
Depends: libstdc++6
Depends: libvorbis0a
Depends: libvorbisenc2
Depends: libvorbisfile3
Depends: libwavpack1
Depends: libx11-6
Depends: libxcomposite1
Depends: libxml2
Depends: libxrender1
Depends: zlib1g
3)   Download both Fauxdacious and the Fauxdacious Plugins tarballs from these respective links.
4)   Untar each.   Switch to the newly-created subdirectory (./fauxdacious-3.7/ for the first).  If you are running a pretty modern Debian-based Linux distro, you can probably simply open a terminal and do:
sudo make install
cd /usr/local/bin
sudo ln -s audacious fauxdacious
5)   If this does not work for you, you’ll need to compile from scratch.  This will involve installing the development versions of several of these libraries.  Here’s a list from the Audacious team and this command will install them for you on a Debian-based system:
sudo apt-get install git automake build-essential libasound2-dev \
libavformat-dev libbinio-dev libbs2b-dev libcddb2-dev libcdio-cdda-dev \
libcue-dev libcurl4-gnutls-dev libdbus-glib-1-dev libfaad-dev libflac-dev \
libfluidsynth-dev libgl1-mesa-dev-lts-utopic libgtk2.0-dev libguess-dev \
libjack-jackd2-dev liblircclient-dev libmms-dev libmodplug-dev libmp3lame-dev \
libmpg123-dev libneon27-gnutls-dev libnotify-dev libpulse-dev \
libsamplerate0-dev libsdl1.2-dev libsidplayfp-dev libsndfile1-dev libsoxr-dev \
libvorbis-dev libwavpack-dev libxml2-dev
6)   Repeat step 4 for the fauxdacious-plugins-3.7.tgz tarball by untarring and switching to the fauxdacious-plugins-3.7/ and try the “sudo make install” command there.
7)   After completing the installation of both tarballs, you should then do:
cd /usr/local/bin
sudo ln -s audacious fauxdacious
If all this fails and / or you wish to go back to Audacious, simply switch back into fauxdacious-plugins-3.7/ and do a “make distclean” command, then do the same in fauxdacious-3.7/ and do the same thing, then reinstall your Audacious packages. (libaudcore, audacious, and audacious-plugins) and you should be back to normal.
8)   To enable video play, edit your “~/.config/audacious/config” file and add the following lines:  (You can change “Fauxdacious Video” to whatever title you would like to appear above the video window).  If you also use the Afterstep windowmanager (as I do), you may want to add the line “afterstep=TRUE” under the “[skins]” section!
video_windowtitle=Fauxdacious Video
TO DO:   I still need to fix an annoying error msg. popup that occasionally comes up saying it can’t find a (should’ve been deleted) playlist.   Right now, it works fine in spite of this.  Next step is to eventually figure out how to “package” all this up into Debian “packages” for simpler installation!   Another thing is including the QT interface (right now I use the WinAmp skins interface and built it with the GTK interface, but not the QT stuff.   I also could use someone with Windows and a good C++ compiler to build a Windows binary version (Audacious has one).  This is something I’m completely clueless about though!

Hacked Audacious Audio Player to play Video!

My favorite (audio) player that I use all the time for music, online radio stations, and even listening to “videos” of someone standing at a pulpit delivering a sermon is “Audacious“, an advanced, free and open-source audio player with both a GTK, QT, and beautiful Winamp skin interface that can play the audio part of nearly anything thrown at it! Over the years I’ve hacked on it a bit to add a few features that make my own use of it a bit easier.  It also has many plug-ins, including “visualization” plug-ins that can pop up a window and display cool visual effects as the music plays.  One day recently, I was listening to a streaming mp4 video sermon and started wondering “why couldn’t there be a visualization plug-in that would simply display the video portion in the visualization window?” I googled around for such a plug-in and found none.  I decided to post on the Audacious plug-in forum (my actual thread) inquiring as to whether anyone else was working on something like this or for advice on how to go about doing one myself.  I got a response back fairly quickly from John Lindgren, the main author of Audacious suggesting that it was probably not worth my time and doubting my ability to create anything comparable to top-flight video players.  I too doubt my abilities to create a top-flight video player but I’m not really interested in doing that, rather my desire is to just create something simple that works reasonably well.  Besides, I’m a retired software developer, have plenty of spare time, and need an occasional programming challenge to keep my mind and skills sharp! Anyway, I took John’s reply as a challenge and now, I’m happy to report that I have a working video option patch to Audacious! To quote the famous words of Buggs Bunny – “He don’t know me vewy well, do he :D!” (Remember – I’M Jim POSSIBLE!)
Jim PossibleI ended up eschewing the “Visual Plug-in” option since those can be turned on and off on the fly and I quickly realized that we needed this either on or off BEFORE the stream is opened, so I ended up zeroing in the “ffaudio” plug-in, which already processes all the formats that have video that I want to play (mp4, avi, flv, swf, etc.) It looks for the audio packets and discards all the rest.  My initial thought for something quick and dirty was to try simply piping the output as it came in to an external program, such as “ffplay.” I quickly got this working pretty well such that I could pause and stop the audio playback in Audacious and the video would pause and play pretty much in sync with the audio! Perfect for streaming, but I wanted MORE!
When playing a downloaded file Audacious has a slider that lets you seek within the audio, which with the video being piped, naturally craters! Therefore, if I wanted a plug-in option worthy of Audacious, I needed to actually process the video within Audacious itself.  I began looking at the ffplay source code and searching around for how to process video streams with ffmpeg and with much trial and error, got it working somewhat.  The controls in Audacious worked, including seeking for the most part (but randomly cratered on some seeks), and the video was often a bit “jerky.” Still not satisfied, I looked at my code closer and found that the problem was that the video and audio packets, which are processed in the order they are received, are often clustered together in bunches.  Therefore, some way was needed to “interlace” them together as much as possible.  Since Audacious is an audio player and does a beautiful job of processing the audio, I wanted to leave this alone as much as possible and let the audio drive the processing, so I decided to try queuing the video packets until an audio packet is read, then processing the next video packet in the queue before processing the audio packet.  This greatly improved things!
Still not happy, I played around some more and realized that while my methodology assumed that the number of audio and video packets would be roughly the same, the reality is that most videos I tested seem to have roughly twice the number of audio packets as video.  I tried one more thing:  only popping a video packet off the queue every OTHER audio packet and suddenly, much to my surprise, the “jitter” was all but GONE! I also got the seek failures all but eliminated by changing the seek mechanism from AVSEEK_FLAG_ANY to AVSEEK_FLAG_BACKWARD to force the seek to the nearest “key” packet after doing some more research.  Anyway, I now have a working patched “ffaudio” plug-in that will, if the user sets the new “play_video” option to TRUE, will pop up a video “visualization” window when playing a stream that contains video! Obviously, it’s not “perfect” like a true video-player such as VLC or mplayer, but tweaking the new queue size (“video_qsize”) and pixel scaling algorithm options (“video_sws_scale”) in the config file, most videos play nearly perfect for me (usually the more noticeable “imperfections” are due to my internet connection and affect all video players!) I’ve submitted my hacked plug-in to the Audacious team for possible inclusion, but based on previous experience, I have some doubts as to when (or whether) they will actually accept it, so if you want to use it now, I’ve included the source here!  (it’s a single file:  ffaudio-core.cc).  To build, download the source for Audacious and Audacious-Plugins, and all the necessary development packages, save and replace the file:  audacious-plugins/src/ffaudio/ffaudio-core.cc with the code included here, rebuild, add the following to your ~/.config/audacious/config file, and give it a try (The last four are commented out with their default values, but you probably don’t need to uncomment or change them.
video_windowtitle=Audacious Video
You will also need to tweak the Makefile in audacious-plugins/src/ffaudio/ to look like this:

SRCS = ffaudio-core.cc ffaudio-io.cc itunes-cover.cc

include ../../buildsys.mk
include ../../extra.mk

plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}

LD = ${CXX}

LIBS += ${GTK_LIBS} ${FFMPEG_LIBS} -lswscale -lavcodec -laudtag -lX11 -lSDL -lz -lm

And the audacious-plugins/extras.mk file to include these two lines to use the SDL library:
Also, if using a version of Audacious higher that v3.6.0, edit ffaudio-core.cc looking for comments containing “BUILD NOTE” as they will direct you to tweak other things for newer versions of Audacious!
You can find some other instructions for building Audacious from scratch here:  http://redmine.audacious-media-player.org/boards/1/topics/788.
Now I’m enjoying streaming youtube video using youtube-dl with one click of a mouse button through my Awesomely-hacked “Fauxdacious” version of Audacious using the following script file on Linux (you’ll need to change “fauxdacious” to “audacious” and most likely:  “stdin://-.mp4” to “-“):
/usr/local/bin/youtube-dl --youtube-skip-dash-manifest -f mp4 --no-part $1 -o - 2>/dev/null | fauxdacious -Dc stdin://-.mp4

Image:  Me watching my alter-ego “Derick Wildstar” gettin’ the girl in The Starblazers Movie:
Space Battleship Yamato 2010” in “Fauxdacious” – YEAH! :D

Get every new post delivered to your Inbox.

%d bloggers like this: