Help - Search - Members - Calendar
Full Version: foo_httpcontrol
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5
oblikoamorale
here you go
CODE
    v0.79 24 Aug
        add: [PATH_JS] - javascript array with current path of built-in
             browser, available in foo_httpcontrol_browser_tpl.html only.
             sample value:
             [ { "cmd": "/?cmd=Browse&param1=%20", "path": "Root:\" },
               { "cmd": "/?cmd=Browse&param1=D%3A\", "path": "D:\" },
               { "cmd": "/?cmd=Browse&param1=D%3A%5CMUSIC\", "path": "MUSIC\" } ]
        add: [PATH_PARENT] - urlencoded uppper level path of current built-in
             browser path. available in foo_httpcontrol_browser_tpl.html only.
        add: [BROWSER_JS] - javascript array of browser files. sample array
             element:
             [ { "p": "directory/file name",
                "pu": "urlencoded full directory/file path",
                "fs": "file size",
                "cm": "file type",
                "ft": "file time/date" } ]
        fix: disappearing network in browser with 'hide non-playables' option;
Auric
One small bug: The component automatically adds a trailing slash to the default path set in preferences. The JavaScript eval function interprets this as you wanting to ignore the closing quote of the "p" element, causing it to error out. Of course, since we have url-encoded path in "pu", "p" may not even be necessary. It's easy to strip the slashes out though, so I'll do that for now.

Thanks for the update.

edit: also, it seems the commas are missing between rows in the BROWSER_JS array.
oblikoamorale
whops, sorry! completely missed the necessity to escape slashes. the issue (along with missing commas) is fixed for newly added macros, and the current version is updated without increasing version number.
Chairman85
QUOTE(Auric @ Aug 24 2008, 16:14) *

One small bug: The component automatically adds a trailing slash to the default path set in preferences. The JavaScript eval function interprets this as you wanting to ignore the closing quote of the "p" element, causing it to error out. Of course, since we have url-encoded path in "pu", "p" may not even be necessary. It's easy to strip the slashes out though, so I'll do that for now.

Thanks for the update.

edit: also, it seems the commas are missing between rows in the BROWSER_JS array.

Any update, Auric?
Chairman85
Any chance for support of embedded album art?
waltereegho
I absolutely love this. Thanks a lot biggrin.gif
Auric
QUOTE(Chairman85 @ Aug 29 2008, 13:58) *

Any update, Auric?


The browser is pretty much done, but I need to implement enqueue support for directories, and I'd like to create subheaders for each album in a playlist. I'll see if I can't release something this week.
RogerM
Awesome work! Any updates?
Chairman85
QUOTE(larskl @ Aug 6 2008, 15:54) *


Here's my modified version. Designed for iPhone, very barebones, no browser. http://www.2shared.com/file/3899339/d6fcdf...ntrol_data.html
Auric
Sorry for the lack of a release; I ran into a memory leak the other day and wanted to make sure it wasn't something in my Javascript. There's still a lot of features I could put in, but I'll try to get something out soon.
Chairman85
QUOTE(Auric @ Sep 9 2008, 11:36) *

Sorry for the lack of a release; I ran into a memory leak the other day and wanted to make sure it wasn't something in my Javascript. There's still a lot of features I could put in, but I'll try to get something out soon.

Any update is good news, Auric. I'd love to help you out if you'd like.
Auric
Ok, here you go:

IPB Image

Download iPhone template release 1

A few notes:

- Like Larskl's template, this one requires that you access it via index.html
- The "playlist row" field in the HTTP Control preferences must be set to the following, or some variation thereof:
CODE
{ "artist": "$ifgreater($len(%artist%),29,$cut(%artist%,29)'...',%artist%)", "album": "$ifgreater($len(%album%),29,$cut(%album%,29)'...',%album%)", "number": "%tracknumber%", "track": "$ifgreater($len($replace(%title%,",)),28,$cut($replace(%title%,",),28)'...',$replace(%title%,",))", "len": "%length%" }
- The shuffle button does not work like the iPhone shuffle, on account of the foobar shuffle not working like the iPhone shuffle. Rather than shuffling the playlist, it picks a single track at random and continues forward from there.
- This template automatically refreshes every 5 seconds, regardless of whether or not you have the auto-refresh option checked in the HTTP Control preferences. This is largely because the the AUTO_REFRESH macro is passed with quotes, and I didn't feel like stripping them out for an option that you should really leave turned on. If there's a demand for it, I'll fix it.
- Many features are missing, on account of it being really hard to mimic Apple's UI with only a single form of user input (left-click). I have a few ideas in the works, but feel free to make suggestions.
Chairman85
Thanks, Auric. Though it chokes on large playlists (3143 items).
rexit2
QUOTE(Chairman85 @ Sep 12 2008, 22:32) *

Thanks, Auric. Though it chokes on large playlists (3143 items).


There is a setting in the http control preferences that is named page entries. Set that to however many playlist entries you want listed per page. Hope that helps.

*Feature Request* I would love to have a way of keyword searching either the playlist or the directory list, this would be extremely useful for those of us with large collections. Thanks again. smile.gif
Auric
QUOTE(Chairman85 @ Sep 12 2008, 19:32) *

Thanks, Auric. Though it chokes on large playlists (3143 items).

Yeah, I kind of expected that. I believe it has to do with the maximum execution time allowed for Javascript on the iPhone. Have you had better luck with other templates?

QUOTE(rexit2 @ Sep 12 2008, 22:51) *

There is a setting in the http control preferences that is named page entries. Set that to however many playlist entries you want listed per page. Hope that helps.

*Feature Request* I would love to have a way of keyword searching either the playlist or the directory list, this would be extremely useful for those of us with large collections. Thanks again. smile.gif

Currently, the playlist does not support pages, as I wasn't designing this with very large playlists in mind. I'll see if I can't work up something up, though. Until then, I would recommend against loading playlists with more than 100 tracks.

A keyword search wouldn't be hard to implement, but like anything else it's matter of where to put it on the screen.
Chairman85
QUOTE(Auric @ Sep 13 2008, 09:54) *

QUOTE(Chairman85 @ Sep 12 2008, 19:32) *

Thanks, Auric. Though it chokes on large playlists (3143 items).

Yeah, I kind of expected that. I believe it has to do with the maximum execution time allowed for Javascript on the iPhone. Have you had better luck with other templates?

Actually, until this point I had been using a very simple layout with no playlist controls, just Play/pause, next, and previous.
Auric
I'm working on breaking the playlist up into chunks and loading them as you scroll. The iPhone has no problem loading the whole playlist into memory, it just can't display it all at the same time.
Steeleye
Thanks for the great plugin and sorry for nitpicking, but "Browse path" restriction is easily avoided appending "..\" to the path.
Of course it's not a problem as long as you have the password set.
oblikoamorale
right, thanks for pointing that out. I'll add additional checks for this case.
Chairman85
QUOTE(Auric @ Sep 14 2008, 10:01) *

I'm working on breaking the playlist up into chunks and loading them as you scroll. The iPhone has no problem loading the whole playlist into memory, it just can't display it all at the same time.

FYI, Firmware 2.1 has added the ability to make a web app run in full screen.

CODE

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Auric
QUOTE(Chairman85 @ Oct 3 2008, 10:53) *

FYI, Firmware 2.1 has added the ability to make a web app run in full screen.

CODE

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />



Good to know; I'll add that in next time I get a chance to work on it.
57hsq
this is great. perfect for my needs. huge thanks to all
The only missing feature for me is some form of search facility. In Foobar proper I use Album List set to 'by folder structure' to search my huge classical collection. Is it possible to emulate something like this function remotely?
carmenm
Auric: Thanks a lot for your work. I use your template but not on an iphone. I use it on my mac with fluid and its amazingly beautiful!!!
Yet i have one problem and 2 feature requests
My problem is that when using your template, the playlist page is not scrollable. I tried with fusion and firefox and it s not scrollable. Maybe it s something you want on iphone but do you know how to change that?

No my first feature request is to have a button on the playlist view to clear it. That can be useful when you want to change the music your listening to: you clear, you browse and you enqueue.
The second feature request is about enqueuing and i am not sure if it is doable.
When in the browser, if i am on a directory containing no mp3 files but directories which contain mp3, if i click enqueue nothing is enqueued. I suppose it is because the function for enqueuing is not recursive. Is it doable?

Thanks for your work, it s beautiful

EDIT: When switching track, the album cover is not refreshed.
Auric
QUOTE(carmenm @ Oct 10 2008, 01:39) *

My problem is that when using your template, the playlist page is not scrollable. I tried with fusion and firefox and it s not scrollable. Maybe it s something you want on iphone but do you know how to change that?

It has to do with how the iPhone handles scrolling. To restore the scroll bar, open up the CSS file and remove the "overflow: hidden" attribute from the BODY element.

QUOTE
No my first feature request is to have a button on the playlist view to clear it. That can be useful when you want to change the music your listening to: you clear, you browse and you enqueue.

I'll see what I can do.

QUOTE
The second feature request is about enqueuing and i am not sure if it is doable.
When in the browser, if i am on a directory containing no mp3 files but directories which contain mp3, if i click enqueue nothing is enqueued. I suppose it is because the function for enqueuing is not recursive. Is it doable?

That's not something I can do on the template end; the plugin would have to support it.

QUOTE
EDIT: When switching track, the album cover is not refreshed.

If you manually switch tracks, it should update. If it switches automatically after the previous track ends, there may be a pause, as the data is only requested every 5 seconds.
oblikoamorale
QUOTE(Auric @ Oct 14 2008, 07:23) *

QUOTE
The second feature request is about enqueuing and i am not sure if it is doable.
When in the browser, if i am on a directory containing no mp3 files but directories which contain mp3, if i click enqueue nothing is enqueued. I suppose it is because the function for enqueuing is not recursive. Is it doable?

That's not something I can do on the template end; the plugin would have to support it.
it has been possible from almost the very beginning with EnqueueDirSubdirs cmd.

QUOTE(Auric @ Oct 14 2008, 07:23) *

QUOTE
EDIT: When switching track, the album cover is not refreshed.

If you manually switch tracks, it should update. If it switches automatically after the previous track ends, there may be a pause, as the data is only requested every 5 seconds.
may I ask why you didn't go in the way suggested by stock template, where the page is being refreshed only on track changes or in case of insufficient playing track data? requesting data every five seconds might be a bit consumptive batterywise.
aequasi
idk if this is supposed to allow this, but whenever i try and access the ip i supply in the program from another computter, i always get a "Forbidden" page
oblikoamorale
QUOTE(aequasi @ Oct 15 2008, 01:30) *

idk if this is supposed to allow this, but whenever i try and access the ip i supply in the program from another computter, i always get a "Forbidden" page
did you set any value to "Remote IP" field in plugin configuration page?
aequasi
QUOTE(oblikoamorale @ Oct 14 2008, 21:56) *

QUOTE(aequasi @ Oct 15 2008, 01:30) *

idk if this is supposed to allow this, but whenever i try and access the ip i supply in the program from another computter, i always get a "Forbidden" page
did you set any value to "Remote IP" field in plugin configuration page?

yup, as the outbound ip of the computer
oblikoamorale
QUOTE(aequasi @ Oct 15 2008, 10:13) *

QUOTE(oblikoamorale @ Oct 14 2008, 21:56) *

QUOTE(aequasi @ Oct 15 2008, 01:30) *

idk if this is supposed to allow this, but whenever i try and access the ip i supply in the program from another computter, i always get a "Forbidden" page
did you set any value to "Remote IP" field in plugin configuration page?

yup, as the outbound ip of the computer

check "Enable logging" in preferences, try to access remotely, and then post screenshot of plugin preferences window and contents of foobar2000 console.
aequasi
http://quasi.schererzoo.com/screenshot.jpg

and yes that is with me trying to remote access, it doesnt show up at all, which leads me to believe its something wrong with vista
oblikoamorale
QUOTE(aequasi @ Oct 15 2008, 16:19) *

http://quasi.schererzoo.com/screenshot.jpg
and yes that is with me trying to remote access, it doesnt show up at all, which leads me to believe its something wrong with vista
I think you misunderstood something. your "bind to interface" field equals to "remote ip". why is that? you said you are trying to connect to machine running foobar2000 remotely.
aequasi
QUOTE(oblikoamorale @ Oct 15 2008, 07:55) *

QUOTE(aequasi @ Oct 15 2008, 16:19) *

http://quasi.schererzoo.com/screenshot.jpg
and yes that is with me trying to remote access, it doesnt show up at all, which leads me to believe its something wrong with vista
I think you misunderstood something. your "bind to interface" field equals to "remote ip". why is that? you said you are trying to connect to machine running foobar2000 remotely.

yes i am, so should bind to be local host? and if so, what should remote be?
oblikoamorale
once again, remote ip defines the one and only ip you're allowing connection _from_.
aequasi
QUOTE(oblikoamorale @ Oct 15 2008, 11:47) *

once again, remote ip defines the one and only ip you're allowing connection _from_.

http://quasi.schererzoo.com/screenshot.jpg

so technically, if im trying to connect remotely from a computer that has the IP 192.168.1.4, this should work?
oblikoamorale
QUOTE(aequasi @ Oct 15 2008, 23:14) *

QUOTE(oblikoamorale @ Oct 15 2008, 11:47) *

once again, remote ip defines the one and only ip you're allowing connection _from_.

http://quasi.schererzoo.com/screenshot.jpg

so technically, if im trying to connect remotely from a computer that has the IP 192.168.1.4, this should work?

no it wont. your http listener service is bound to localhost ip which is unreachable from the remote machine unless you set up the routing
change it to whatever ip has the network card connected with the remote machine (192.168.1.5 iirc judging by your previous screenshot)

ps I hope you are not trolling
Auric
QUOTE(oblikoamorale @ Oct 14 2008, 07:14) *

it has been possible from almost the very beginning with EnqueueDirSubdirs cmd.


Ahh, I stand corrected. I posted in haste without checking the available commands. Now to find room for another button on the template...

QUOTE
may I ask why you didn't go in the way suggested by stock template, where the page is being refreshed only on track changes or in case of insufficient playing track data? requesting data every five seconds might be a bit consumptive batterywise.


I would need to read the track length and set up a timer to request the data at the presumed end of the track. Certainly doable; I just haven't had time yet.


carmenm
QUOTE(Auric @ Oct 14 2008, 05:23) *

QUOTE(carmenm @ Oct 10 2008, 01:39) *

My problem is that when using your template, the playlist page is not scrollable. I tried with fusion and firefox and it s not scrollable. Maybe it s something you want on iphone but do you know how to change that?

It has to do with how the iPhone handles scrolling. To restore the scroll bar, open up the CSS file and remove the "overflow: hidden" attribute from the BODY element.

Thanks but i would like my page to be scrollable with mouse wheel but still hide the scrollbar. Is it possible?
aequasi
QUOTE(oblikoamorale @ Oct 15 2008, 22:14) *

QUOTE(aequasi @ Oct 15 2008, 23:14) *

QUOTE(oblikoamorale @ Oct 15 2008, 11:47) *

once again, remote ip defines the one and only ip you're allowing connection _from_.

http://quasi.schererzoo.com/screenshot.jpg

so technically, if im trying to connect remotely from a computer that has the IP 192.168.1.4, this should work?

no it wont. your http listener service is bound to localhost ip which is unreachable from the remote machine unless you set up the routing
change it to whatever ip has the network card connected with the remote machine (192.168.1.5 iirc judging by your previous screenshot)

ps I hope you are not trolling

ok i got it, thanks, and no im not trolling lol
Auric
QUOTE(carmenm @ Oct 16 2008, 04:43) *

Thanks but i would like my page to be scrollable with mouse wheel but still hide the scrollbar. Is it possible?


For all intents and purposes, no.
carmenm
QUOTE(Auric @ Oct 18 2008, 23:19) *

QUOTE(carmenm @ Oct 16 2008, 04:43) *

Thanks but i would like my page to be scrollable with mouse wheel but still hide the scrollbar. Is it possible?


For all intents and purposes, no.

Good to know thank you
odyssey
When any tag is updated, foobar2000 freezes for up to 15 seconds (at least when a large playlist is active, >30000 entrys). crying.gif
oblikoamorale
Patient: Doctor, it hurts when I do this...
Doctor: Then stop doing it...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.