PDA

View Full Version : Moose - PC slim app



Dr Lovegrove
2005-08-30, 03:26
Ordered my 3rd squeezebox over the weekend, and to celebrate I thought
I'd share the little pc application I've been working on for the past
few months.

It's called Moose and it's a fast non-web-based front-end for
searching and selecting music.

I've thrown some very rough instructions together and uploaded it all to:
http://www.rusticrhino.com/drlovegrove

Hope someone finds it useful.

Feel free to send comments and stuff.

Thanks,

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

biggles
2005-08-30, 03:36
Looks fantastic! Will DL as soon as I get home!

Great work and thanks a bunch!

adhawkins
2005-08-30, 03:52
Hi,

In article <67fb4bc405083003264b43217b (AT) mail (DOT) gmail.com>,
Dr Lovegrove<drlovegrove (AT) gmail (DOT) com> wrote:
> Feel free to send comments and stuff.

Would be good if it worked remotely (i.e. didn't need direct access to the
music directory).

Andy

Robin Bowes
2005-08-30, 04:08
Dr Lovegrove wrote:
> Ordered my 3rd squeezebox over the weekend, and to celebrate I thought
> I'd share the little pc application I've been working on for the past
> few months.
>
> It's called Moose and it's a fast non-web-based front-end for
> searching and selecting music.
>
> I've thrown some very rough instructions together and uploaded it all to:
> http://www.rusticrhino.com/drlovegrove
>
> Hope someone finds it useful.
>
> Feel free to send comments and stuff.

Hi,

I just grabbed this and tried it out.

Unfortunately, it's not an awful lot of good to me as my music library
is on a linux box, not local. I guess your app. is only of use to folk
running slimserver on Windows and running Moose on the same box.

What would be *really* cool would be if you could use the existing
slimserver DB through the CLI.

Nice app though.

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

Dr Lovegrove
2005-08-30, 04:14
> Would be good if it worked remotely (i.e. didn't need direct access to the
> music directory).

Hi Andy,

Yeah, this is definitely something I'm going to look at in the future.

At the moment I tend to run it from my mp3 server machine to generate
the database (moo file), then copy the database onto my local machine
where I use it locally. It can't currently scan over a LAN via UNC paths
as there would be big problems with shortcut files I think.

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

Dr Lovegrove
2005-08-30, 04:37
On 30/08/05, Robin Bowes <robin-lists (AT) robinbowes (DOT) com> wrote:
>
> Unfortunately, it's not an awful lot of good to me as my music library
> is on a linux box, not local. I guess your app. is only of use to folk
> running slimserver on Windows and running Moose on the same box.

Indeed, the server needs to be windows.. You can copy the moo
file from the server to a remote machine (or share it over a network)
though.

> What would be *really* cool would be if you could use the existing
> slimserver DB through the CLI.

Yeah, for re-building moose's database remotely, I was wondering
whether the CLI would be fast enough, or whether I should parse the
db file itself via SQLite. I presume if you shared the db file in linux,
you'd be able to access it remotely via windows ?

> Nice app though.

Cheers.. :-)

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

Robin Bowes
2005-08-30, 05:05
Dr Lovegrove wrote:
>
> Indeed, the server needs to be windows.. You can copy the moo
> file from the server to a remote machine (or share it over a network)
> though.

True - but I run Linux!

>>What would be *really* cool would be if you could use the existing
>>slimserver DB through the CLI.
>
>
> Yeah, for re-building moose's database remotely, I was wondering
> whether the CLI would be fast enough, or whether I should parse the
> db file itself via SQLite.

You could take one of two approaches:

1. Replicating the slimserver db locally, either by copying the SQLite
file or through (a lot of) CLI commands

2. Write a search interface that uses CLI to perform searches against
the slimserver DB.

I suppose it would depend on your reasons for writing the app. i.e. what
are your design goals? I suspect there a few people who would appreciate
a snappy, windows-based client with which to control their squeezeboxes.
Option 1 would give probably give better performance, but Option 2 would
offer greater consistency.

> I presume if you shared the db file in linux,
> you'd be able to access it remotely via windows ?

Probably not; you'd most likely run into locking issues.

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

Todd Fields
2005-08-30, 11:06
--- Dr Lovegrove <drlovegrove (AT) gmail (DOT) com> wrote:

> It's called Moose and it's a fast non-web-based front-end for
> searching and selecting music.

This looks very cool although I haven't tried it yet. Actually,
it looks kind of like what I've always wanted for playlist
creation (not just for my Squeezebox.) In fact it would be nice
to have a save playlist button that could name and save a M3U.

My PC running SlimServer is tucked away and does not even have a
mouse or keyboard connected to it. I add things to my music
folder via shared folders over my home network. I guess from
the posts I'm reading that Moose needs to be installed directly
on the PC with my music library. I could install it on the PC
and then use VNC to access it but this isn't an ideal solution
(mainly because going the VNC route is not wife friendly.)

chris
2005-08-30, 23:12
If your linux machine is accessible as a share, then it seems to work (pointed it to \\linuxmachine\sharename\).

Umm, until it threw this error at me:


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Moose.Scan.DoScan(Library library, String sSourcePath, String sRootPath, Int32 nLevel)
at Moose.Scan.DoScan(Library library, String sSourcePath, String sRootPath, Int32 nLevel)
at Moose.MooseForm.ReadLibrary(String sPath)
at Moose.MooseForm.DoRescan()
at Moose.MooseOptions.buttonRescan_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
Moose
Assembly Version: 1.0.2068.17742
Win32 Version: 1.0.2068.17742
CodeBase: file:///C:/Documents%20and%20Settings/Chris/Desktop/Moose.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Web
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2037
CodeBase: file:///c:/windows/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.

chris
2005-08-30, 23:14
It'd be great for this to work, by the way. I was looking for a simple UI for use at parties. If it could manage a playlist (display what's "coming up", selected by guests already), then it'd be fantastic!

Oh .. and, of course, if it'd work ;) (see post above).

Dr Lovegrove
2005-08-31, 02:24
On 31/08/05, chris <chris.1um7qz (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> If your linux machine is accessible as a share, then it seems to work
> (pointed it to \\linuxmachine\sharename\).
>
> Umm, until it threw this error at me:

Hi Chris, thanks for that.. I'll have a look into supporting network
shares - hopefully should be quite an easy fix.

After that, I'm hopefully going to implement an option to query
a copy of the server's db file..

Cheers,

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

Dr Lovegrove
2005-08-31, 04:45
On 31/08/05, Dr Lovegrove <drlovegrove (AT) gmail (DOT) com> wrote:
> > If your linux machine is accessible as a share, then it seems to work
> > (pointed it to \\linuxmachine\sharename\).
> >
> > Umm, until it threw this error at me:
>
> Hi Chris, thanks for that.. I'll have a look into supporting network
> shares - hopefully should be quite an easy fix.

Just uploaded version 0.02 which should hopefully fix the problems
with scanning network shares.

Thanks,

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

chris
2005-08-31, 05:31
It certainly does fix the scanning. Not quite sure what the three progress bars are trying to tell me, but after some seemingly random movement, the scan was sucessful.

It came up with a list of folders in which it found music - organised a little oddly, but I suspect this is to do with the way I have my music sorted.

Clicking through songs or albums, and clicking 'play' with no MAC ID didn't, however, play the song with the default player (it did nothing).

Clicking 'Copy' didn't work either. No error, but no file in C:\ either.

Cheers,
Chris

Dr Lovegrove
2005-08-31, 06:27
On 31/08/05, chris <chris.1umpcb (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> It certainly does fix the scanning. Not quite sure what the three
> progress bars are trying to tell me, but after some seemingly random
> movement, the scan was sucessful.

Ah, the progress bars, yes.. They show the traversal through the
scan. The top one is the root directory, the next one is each folder
in the root, then the third is each item in that folder. Usually it's just the
top two which are useful, but it depends on the structure of your
collection. If you had say two directories 'flacs' and 'mp3s' in your
root, the 2nd progress bar would probably be more use as the first
would only be at 0% or 50%.. I know it's a bit confusing, but it
saves doing a pre-scan just to work out how many files, etc..

> It came up with a list of folders in which it found music - organised a
> little oddly, but I suspect this is to do with the way I have my music
> sorted.

Yes the structure's all a bit hard-coded in an artist\album\tracks kind
of way. Hopefully the db scanning code should get round this..

> Clicking through songs or albums, and clicking 'play' with no MAC ID
> didn't, however, play the song with the default player (it did
> nothing).

Hmmm, strange.. Works fine here.. I did just fix a bug that was
caused if the audio root directory entry in the options dialog
has a trailing '\'. This seemed to cause a number of problems.
(you'll need to rescan again after changing it)

> Clicking 'Copy' didn't work either. No error, but no file in C:\
> either.

Might be the trailing slash problem again. Also, Copy was really
designed to work with whole Albums or Artists. If a file is selected
it simply doesnt do anything. This was actually by design, but
it really should error with the choice of either copying the whole
album or just the single file. If you click on an album or artist it
should work though, even over a network.

Hope that helps,

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

Marc Sherman
2005-08-31, 06:49
Dr Lovegrove wrote:
>
> Ah, the progress bars, yes.. They show the traversal through the
> scan. The top one is the root directory, the next one is each folder
> in the root, then the third is each item in that folder. Usually it's
> just the top two which are useful, but it depends on the structure of
> your collection. If you had say two directories 'flacs' and 'mp3s' in
> your root, the 2nd progress bar would probably be more use as the
> first would only be at 0% or 50%.. I know it's a bit confusing, but
> it saves doing a pre-scan just to work out how many files, etc..

You can do a one-pass tree traversal on a single progress bar using the
following pseudocode algorithm:

updateProgressBar(0.0);
traverseDir(rootDir, 0.0, 1.0);

traverseDir(dir, start, dirTarget) {
children[] = dir.getChildren();
sharePerChild = (dirTarget - start)/children.size();
current = start;
for each child in children[] {
if(child.isDirectory()) {
traverseDir(dir, current, current+sharePerChild);
} else {
processFile(child);
}
current += sharePerChild;
updateProgressBar(current);
}
}

It won't move the progress bar a uniform amount for each file, but
assuming a fairly uniform distribution of files in the directory tree,
it should behave rationally.

- Marc

chris
2005-08-31, 07:10
Hmmm, strange.. Works fine here.. I did just fix a bug that was
caused if the audio root directory entry in the options dialog
has a trailing '\'. This seemed to cause a number of problems.
(you'll need to rescan again after changing it)
Ah, copying works fine - but still doesn't play anything. I've selected 'Player 1' and deleted the XXXX's, so figured it'd launch Winamp.

Don't know if it's relevant, but my SB is currently unplugged.

Dr Lovegrove
2005-08-31, 08:01
On 31/08/05, chris <chris.1umtqn (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> Ah, copying works fine - but still doesn't play anything. I've selected
> 'Player 1' and deleted the XXXX's, so figured it'd launch Winamp.
>
> Don't know if it's relevant, but my SB is currently unplugged.

Ah, well spotted.. Bit of a bug there.. Basically the empty mac address
trick only works if in the old HTTP mode. Click 'Use HTTP/Web interface'
in the options dialog, and winamp should play files. I'll fix this for the next
version.

Note that if you 'play' albums or artists rather than actual files, an explorer
window will pop up rather than winamp as it's just doing a shell execute
on the item. Maybe adding a definable 'local play prefix' would be the thing
to do here, so you could add winamp.exe into the shell execute. I'll give that
a whirl..

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

Dr Lovegrove
2005-08-31, 08:04
On 31/08/05, Marc Sherman <msherman (AT) projectile (DOT) ca> wrote:
>
> You can do a one-pass tree traversal on a single progress bar using the
> following pseudocode algorithm:
>
> It won't move the progress bar a uniform amount for each file, but
> assuming a fairly uniform distribution of files in the directory tree,
> it should behave rationally.

Thanks for that Marc, I'll pop it in. Should make things a bit clearer.

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove

chris
2005-08-31, 08:22
What I'd really like, whilst I'm redesigning your application for my own goals ;-), is to manage a local copy of the SB playlist so that you can drag/drop songs into the list - and move them around.

This would make your application a great front-end for party use. The remote, I find, is too fiddly for drunken people ... but hammering away on a laptop is something everyone can cope with.

No problem if this isn't the direction you're heading, but I thought I'd try :-)

Dr Lovegrove
2005-08-31, 08:47
On 31/08/05, chris <chris.1umx7n (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> What I'd really like, whilst I'm redesigning your application for my own
> goals ;-), is to manage a local copy of the SB playlist so that you can
> drag/drop songs into the list - and move them around.
>
> This would make your application a great front-end for party use. The
> remote, I find, is too fiddly for drunken people ... but hammering away
> on a laptop is something everyone can cope with.
>
> No problem if this isn't the direction you're heading, but I thought
> I'd try :-)

Hey, no worries.. Actually building playlists and editing the current
playlist were two things I had in mind for it. There's already the 'add'
button, and it tells you how many files are in your current playlist and
where you are down the bottom.. Moving this to another window
which lists/edits playlists, live or non-live, shouldnt be too much
trouble.

--
- Dr Lovegrove
http://www.rusticrhino.com/drlovegrove