I want these to help check for memory leaks and other problems. Maybe
one day I can run them through Jenkins!
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I've found that without ALSA enabled, the about-to-finish will hang. To
solve this, I only enable it when ALSA is enabled.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
GTK was printing a warning whenever a non-escaped string was hovered
over. The tooltip was also empty.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This function returns a newly allocated string, so I can't set it
directly to a C++ string since this will leak memory. Instead, I need
to keep the char* pointer around to free it.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
Each script acts as an ocarina sub-command, and each write through the
ocarina-write-pipe script. Note that these scripts cannot be run
directly, and need to run through a processor in the Sconstruct file to
set the correct paths.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
My Sconstruct now supports installing a debug build to
/usr/lib/ocarina-debug and launching through ocarina-debug. This should
allow me to test pipe related scripts
The UI now passes in a string to use as the filename. In addition, I
store the filename and remove it when the application is closed. If the
pipe already exists, then I return the path without creating a new one.
Pipes will only be removed by the application that creates them.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I save the song before refreshing the library so I can scroll back to
it. This way the user isn't interrupted too much...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I want to store the currently selected row and go back there after a
refresh or a filter. This allows me to find the current songid and
scroll back to it later.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I eventually want to be able to choose what columns are shown, so I need
them added to the treeview but now shown.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
The tooltip is the filepath of the selected track. This should help me
figure out what some non-tagged tracks are...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I keep one array instead of two, and I store more information for each
array entry. I can then find the size of the array for the number of
columns, and I can add new columns without having to modify the allay,
treestore and liststore.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
The library only needs to refresh if new tracks were found, so don't do
anything if nothing new has been added.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I eventually only want the library page to have this header, but setting
this up allows me to remove the "switched page" logic that may (or may
not) have been causing problems.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I created a new preference for "Using ALSA" that people can set if they
want to use extra alsa features. This should allow the UI to provide a
dropdown list of outputs that users can select. Once a UI is in place,
users can play music either on their computer speakers or pipe it out to
their blu ray players (or other device).
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
After listening to a long queue, I noticed that there were problems
re-realizing widgets after moving the footer to a different page (the
header might have the same problem?). I decided to fix this issue by
creating a new footer instance for each notebook page.
If I do the same thing for the page header then I can get rid of the
"move this widget from page X to page Y" logic AND allow pages to use
their own custom header AND allow for separate library and queue
filters.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
If the text is "play", "pause", or "next" then I call the appropriate
libsaria function. I eventually plan on adding more commands so bash
can act as a generic remote control, but for now this is a good start!
To use: `echo play > ~/.config/saria[-debug]/saria.pipe` after creating
the fifo (see scripts/makepipe).
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I should eventually work this into the main ocarina script somehow, but
probably not until I get generic commands going. `ocarina openpipe`
should do...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I have a hard time remembering how this works, so instead I leave it up
to the UI to determine how to handle this event running from multiple
threads.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
Gstreamer uses multiple threads, and doing gtk calls outside the main
thread can lead to X11 errors. I get around this by creating a new
signal to respond to by the main loop.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
The new code is a bit simpler, and it correctly fills in the list of
library paths during startup (I still have no idea why this didn't
happen with the old code).
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This makes it easier to loop over all the library paths without needing
to know anything about implementation. I modified the update functions
to use the new way, so it should be ready for use by the UI.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I moved ocarina over to the new system, so the old one can go away now
since it isn't thread safe and nothing uses it anymore.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I use the gdk threading functions to change my gtk code. This should
create fewer UI inconsistencies whenever anything changes, and it should
also allow me to trigger TRACK_LOADED from a new gstreamer thread.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
Rather than keeping a map of function pointers, I want the UI to
register a single function that takes a callback_t as an argument. From
there, the UI can decide the best way to handle callback lookups (such
as grabbing a lock before changing anything). At the very least, a
switch statement or array lookup should be faster than searching a map.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
When either HOME or XDG_CONFIG_HOME are unset getenv() can return NULL.
C++ strings don't like being set to NULL, so we need to check for this
case.
Bryan: Edited Sconstruct and commit message.
Signed-off-by: Josh Larson <theMutatedShrimp@gmail.com>
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I found it was calling itself over and over again, rather than calling
the stdlib rand(). This wasn't the desired behavior...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
I have been doing this as part of the release process, but it's slightly
easier to do it as a commit after. I was having too much trouble
keeping the hash correct in the last few months.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
If a file has been moved to another location in the same library root
the new location won't be added since it'll have the same inode number.
The track would then be removed during the library validation step. I
switch the order for correctness.
It was being initialized with '==' instead of '=', so the for loop was
always causing a segmentation fault. This was caused by commit
180707a6c2
Author: Bryan Schumaker <bjschuma@gmail.com>
Date: Thu Dec 29 22:08:53 2011 -0500
libsaria: Remove redundant code
Nothing needs to call this function anymore. I also cleaned
up the header file a bit.
I check two things during this step:
1) Does the file still exist?
2) Does the file have the same inode number?
If the answer to either of these is "no", then the track is removed from
the library.