Commit Graph

1424 Commits

Author SHA1 Message Date
Bryan Schumaker
5d687176e8 tests: Began creating test programs
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>
2012-02-09 08:22:40 -05:00
Bryan Schumaker
9e322433d5 libsaria: Set about-to-finish from ALSA
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>
2012-02-09 08:04:52 -05:00
Bryan Schumaker
46ae66634e Ocarina: Check for a current alsa device before setting
Otherwise we set a C++ string to NULL and it throws an exception...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-09 08:04:01 -05:00
Bryan Schumaker
9ead002ab8 ocarina: Add stop as a pipe action
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-09 08:03:54 -05:00
Bryan Schumaker
234626ea81 ocarina: Escape tooltip text
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>
2012-02-08 08:24:07 -05:00
Bryan Schumaker
cefbf36415 ocarina: Free strings created by g_markup_escape_text()
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>
2012-02-08 08:19:48 -05:00
Bryan Schumaker
dce461656f scons: Install multiple scripts
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>
2012-02-08 08:11:14 -05:00
Bryan Schumaker
152e7009d8 scons: Create a ocarina-debug launcher
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
2012-02-08 08:11:14 -05:00
Bryan Schumaker
a1672b83c4 scripts: Remove makepipe
This is now handled by libsaria

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:14 -05:00
Bryan Schumaker
280baa7572 libsaria: Allow different UIs to use a different pipe
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
0aa8b950a9 ocarina: Scroll to saved song
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
362a0697c9 ocarina: Scroll to a songid instead of a Track
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
bc0be6d831 ocarina: Set column visibility through function
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
a3c8128bbe ocarina: Add a tooltip column to the liststore
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
f72447decc ocarina: New column registering framework
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
8623779210 libsaria: Reduce library refreshes during update
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
6fd4d01e37 ocarina: Each page gets its own custom header
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
551ae682b5 ocarina: Provide a UI for using ALSA
You can either turn it on or off, and then you can select an output
device from a dropdown list.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
01288e1a86 Libsaria: Make alsa controls its own thing
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
56f0e801f5 ocarina: Give each page its own footer
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
41467524db ocarina: Listen for text written to a named pipe
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
82b9974448 libsaria: Get the path to the pipe file
This will either return the full path to the file or an empty string if
no pipe has been created.
2012-02-08 08:11:13 -05:00
Bryan Schumaker
e1c527c6e7 Add a script to create a pipe
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
4c36e0b7e2 ocarina: Don't set progress bar to a value greater than pipeline
duration

This can happen because of gapless playback in the gstreamer pipeline.
It fails a gstreamer assertion, so I need to look out for it.
2012-02-08 08:11:13 -05:00
Bryan Schumaker
b2f72df146 libsaria: Don't notify_audio_changed() in main loop
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
1f02fa3d9c ocarina: Force callbacks onto the main thread
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
747ba85fbb libsaria: Never return negative duration
A negative duration doesn't make sense, so return 0 instead.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
e7e1bb352a libsaria: Remove OutFile print statement
It was triggering too often during a library update, so I removed it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
c7abfb6496 libsaria: Save queue in a background task
We can easily do this a little bit later to improve performance.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
4b9fde453b Ocarina: Clean up the settings page
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
808927da45 libsaria: Export size of a library path to the UI
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
a0b7718ee7 ocarina: Don't lock gdk when doing an idle_add call
idle_add needs the gdk lock, so it can't already be held when entering.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
1daa12ee81 libsaria: Create a library path iterator
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>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
12b193cc80 libsaria: Move LibraryPath to a global header
I am going to expose this class to the UI so it can directly access
information (size, path, ...).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:12 -05:00
Bryan Schumaker
d6c48ca177 libsaria: Add the library path to the libsaria namespace
I want to move it to a global header file, so it needs to be added to
the libsaria namespace.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:12 -05:00
Bryan Schumaker
3d511a1f19 libsaria: Remove old callback framework
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>
2012-02-08 08:11:12 -05:00
Bryan Schumaker
6b6b2814c3 ocarina: Created thread-safe ocarina callbacks
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>
2012-02-08 08:11:12 -05:00
Bryan Schumaker
7150e8bdee libsaria: Prepare for a single callback handler function
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>
2012-02-08 08:11:12 -05:00
Bryan Schumaker
12f6723111 Begin work on Ocarina 5.6 2012-02-08 08:11:12 -05:00
0d63656df8 Fixed bug with unset environment variable.
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>
2012-02-08 08:10:19 -05:00
Bryan Schumaker
fe7bf9e445 libsaria: Check if a song exists before loading it
This could lead to a segmentation fault if we don't do it...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-07 22:25:13 -05:00
Bryan Schumaker
51e5887971 libsaria: Rename the index rand() function
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>
2012-02-07 08:47:24 -05:00
Bryan Schumaker
d00ed2ebdc Update PKGBUILD for the new release
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>
2012-01-23 08:21:26 -05:00
Bryan Schumaker
4f0671e4a7 Ocarina 5.5 2012-01-23 08:04:39 -05:00
Bryan Schumaker
e11df95c1b Ocarina 5.5-rc 2012-01-04 08:28:07 -05:00
Bryan Schumaker
3e458e2d9f libsaria: Validate library before adding new songs
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.
2012-01-04 08:22:21 -05:00
Bryan Schumaker
b503536d57 libsaria: Fix iterator initializer bug
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.
2011-12-31 11:19:31 -05:00
Bryan Schumaker
e21f0e251c libsaria: LibraryPath()s load their own directory
It makes more sense to set this variable directly from the save file
rather than read it in and pass it as an argument.
2011-12-31 11:13:36 -05:00
Bryan Schumaker
41ec0b68e0 libsaria: Validate library tracks after updating
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.
2011-12-31 10:48:05 -05:00
Bryan Schumaker
d4ac6a870f ocarina: Remove from queue keybinding
Select some tracks and press delete.
2011-12-30 23:32:07 -05:00