Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_httpcontrol (Read 939397 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_httpcontrol

Reply #400
Quote
vairulez, I don't quite get it, you want file browser to clear active playlist prior to adding enqueued files?

exactly, i would like to clear the active playlist+ playing song, prior to adding the new files.
It could be a option in the browser next to "add dir + subfolders to enqueue" ?

foo_httpcontrol

Reply #401
exactly, i would like to clear the active playlist+ playing song, prior to adding the new files.
It could be a option in the browser next to "add dir + subfolders to enqueue" ?
ok, here is the browser option to illustrate the principle. you can use this approach to empty playlist prior switching to Browser mode or whenever you like. foo_httpcontrol_browser_tpl.html

foo_httpcontrol

Reply #402
Great plug-in! I will create a template for personal use that I will share when it's up. I just have to get used to JavaScript before. I will try to replace the functionality I once got using fullscreen configurations for trackinfo_mod, just remotely accessible.

Erm, and I added the component to the Hydrogenaudio wiki.

foo_httpcontrol

Reply #403
exactly, i would like to clear the active playlist+ playing song, prior to adding the new files.
It could be a option in the browser next to "add dir + subfolders to enqueue" ?
ok, here is the browser option to illustrate the principle. you can use this approach to empty playlist prior switching to Browser mode or whenever you like. foo_httpcontrol_browser_tpl.html


thanks, I'll have a look tomorrow, and will share my template (a mix of what has been posted here)

foo_httpcontrol

Reply #404
OK your code works great, but when i tried to reuse it to do my replace function (1.empty playlist, 2. enqueue dir, 3.play 1st song of the playlist) it doesn't work ...
As you have already noticed i am not a coder, especially in javascript ...
here's what i tried to do :

Code: [Select]
<script language="JavaScript" type="text/javascript">
<!--
function getXMLHTTP()
{
    try {return new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e) {try {return new ActiveXObject("Microsoft.XMLHTTP");}
    catch(e) {}}
    if(typeof XMLHttpRequest != "undefined") {return new XMLHttpRequest();}
    return null;
}

function EmptyPlaylist()
{
    httpRequestStatus = getXMLHTTP();
    try {
        httpRequestStatus.open("GET", '/?cmd=EmptyPlaylist&param3=NoResponse', true);
        httpRequestStatus.send(null);
    }
    catch(e) { }
}

function ReplacePlaylist()
{
httpRequestStatus = getXMLHTTP();
    try {
        httpRequestStatus.open("GET", '/?cmd=EmptyPlaylist&param3=NoResponse', true);
                httpRequestStatus.open("GET", '/?cmd=Browse&amp;param1=[PATH]&amp;param2=EnqueueDir', true);
                httpRequestStatus.send(null);
}
    catch(e) { }
}
              

//--></script>

Replace: [ <a title="replace current directory files only" href="java script:ReplacePlaylist()">Dir</a>]


guess what, it doesn't work.
Your help would be welcome

ps : As it didn't work I didn't try to have 3. working

by the way here's what my template looks like :




foo_httpcontrol

Reply #405
Couldnt tell you if it will work after this but you seem to have a space between java and script;

Code: [Select]
href="java script:ReplacePlaylist()">Dir</a>]

foo_httpcontrol

Reply #406
vairulez, your code doesn't make sense because you don't seem to understand the way asynchronious requests work. I suggest you read something on XMLHttpRequest. and again we're way off the topic thread, but oh well, here you go. both files are needed in component data folder to make things work: foo_httpcontrol_browser_tpl.html foo_is_enqueueing.html

foo_httpcontrol

Reply #407
thank you so much, it works great.
I will post my template later today

foo_httpcontrol

Reply #408
thank you so much, it works great.
I will post my template later today
by the way, you should modify the code to prevent user from hitting "add & replace" when this operation is already in progress.

also, next version of component will contain cmd to query fb2k state via custom string specified in request, which will eliminate the need to introduce additinal template files like I did in this your case (to discover if fb2k still processing added files, and has the time to issue start playback command arrived yet).

foo_httpcontrol

Reply #409
Can anyone help me on why this isnt working?;

Code: [Select]
function FormatTime(t) {
    h = Math.floor(t / 3600);
    m = Math.floor((t % 3600) / 60);
    s = pad(t % 60, "0", 2);
    return m+":"+s;

    if (fooVars["trackpos"] != fooVars["tracklen"]) {
    document.getElementById("position").innerHTML = FormatTime(fooVars["trackpos"])
    document.getElementById("length").innerHTML = FormatTime(fooVars["tracklen"]);
    }
}




Can take it to PM, to stop cluttering up the thread if needs be?

This is what I have so far -



Works great on my phone, and also in Opera, Firefox, and Chrome. But not IE.

foo_httpcontrol

Reply #410
Can anyone help me on why this isnt working?;
why should it work (I assume by "work" you mean assigning values to objects properties) when you are returning from FormatTime() function just before the actual assign?

foo_httpcontrol

Reply #411
Can anyone help me on why this isnt working?;
why should it work (I assume by "work" you mean assigning values to objects properties) when you are returning from FormatTime() function just before the actual assign?


Perhaps I should have worded it as can anyone tell me where I am going wrong, rather than why isnt it working.

Nevermind, I'll keep fiddling with it and try to keep this sort of non-plugin-specific query out of the thread.

foo_httpcontrol

Reply #412
Perhaps I should have worded it as can anyone tell me where I am going wrong, rather than why isnt it working.
it's hard to say without seeing actual context, but the good start would be moving return m+":"+s; to the end of the function.
also don't forget to check browser's javascript error console, it is often handy when something doesn't work and you have no clue why. using javascript debugger helps as well (FireBug f.e. is a nice one).

foo_httpcontrol

Reply #413
Perhaps I should have worded it as can anyone tell me where I am going wrong, rather than why isnt it working.
it's hard to say without seeing actual context, but the good start would be moving return m+":"+s; to the end of the function.
also don't forget to check browser's javascript error console, it is often handy when something doesn't work and you have no clue why. using javascript debugger helps as well (FireBug f.e. is a nice one).


All I'm trying to do is pull the current position time, and the track length time from the controls html file and display it in my html file where the 0:00:00 are shown on the image above. But using the FormatTime to turn the numbers into an actual time format.

I'm just using recycled/edited code from other configs, but the ones I'm looking at have a progress bar too, and as I don't really know what I'm doing its hard to distinguish which parts are part of the progress bar feature and the bits necessary for just the time part.



I'll give the javascript tools a go cheers.

foo_httpcontrol

Reply #414
I'm just using recycled/edited code from other configs, but the ones I'm looking at have a progress bar too, and as I don't really know what I'm doing its hard to distinguish which parts are part of the progress bar feature and the bits necessary for just the time part.
having read that, I think you have only two ways: either try to figure it out by yourself, or post the whole files of your work for someone to help you.


foo_httpcontrol

Reply #416
I want to thank oblikoamorale firstly for this GREAT plugin. So far it changes the entire way I use foobar  I love the template vairulez, but would it be possible to add a search entire library section, so it would be possible to add new songs from the entire library to the active playlist? That would be amazing for parties and other such events, where a terminal can be set up and people can queue what they want by using a simple search and click to queue to list  I can't wait to see what the future versions and UI's for this entail.
Thanks again -x2

foo_httpcontrol

Reply #417
i think this component definitely needs an own website. now if i want to browse templates or find any info i have to go through 17 pages of posts which is _very_ unconvenient and unnecessarily time-consuming.

i think it would be great to have a google code (for example) project for this (of course only if you like the idea of opening the source code - and i see no reason in the way of this besides your personal approach and point of view maybe;)). then problems could be tracked, discussed and handled in a much more organized way, changes could be tracked more easily, the "link isn't working" problems would be eliminated (i guess gcode is quite reliable;)) and the wiki + downloads sections could be used to put up templates (this *share method is really lousy). just a few advantages which came to my mind...

when i switched to this version control stuff, i couldn't imagine how could i handle my projects without it earlier.

also, templaters, please use something nicer for file names, coz it's not too cool to have 10 foo_httpcontrol_data.zip files. the proper way is when each file has a name and a version, too IMHO.

anyway, thanks again for your work, it's really impressive and useful.

foo_httpcontrol

Reply #418
I hate to send this thread all the way back to square one, but I'm having a stupid problem. I can use the interface fine locally on both my desktop and netbook, but when I try to use the netbook to control the desktop I can't even get a blank page (yes, I DID change the port)! I have folders sharing across the network, so I just don't know whats happening here.

I should mention, I have a strange internet setup whereby I have to connect to the internet via a gateway or something in my apartment. This prevents me from accessing my router settings unless I unplug it from that network. However, my UPnP network is visible over that connection, and I can even see UPnP and DAAP servers from other apartments!

Thanks in advance, this is exactly the type of program I am looking for.

foo_httpcontrol

Reply #419
it doesn't look like the component problem. all I can suggest is double check the sanity of ip address you are binding to. considering that your network setup is tricky even for you, the owner, how do you expect to be helped by clueless outsiders?

foo_httpcontrol

Reply #420
it doesn't look like the component problem. all I can suggest is double check the sanity of ip address you are binding to. considering that your network setup is tricky even for you, the owner, how do you expect to be helped by clueless outsiders?

Fair enough. However, I ran everything with the network disconnected from the apartments internet and it still didn't work. Sigh.

Thanks anyway, the plugin looks great.

foo_httpcontrol

Reply #421
I've pretty much got to a point where I'm happy with my remote now. Except the playlist switcher.

Heres what it looks like;



No doubt my code here is far from perfect, but the files are attached incase anyone wants to use them/improve it.
http://tiny.cc/aGBY6


Thanks again to oblikoamorale for the plugin.

foo_httpcontrol

Reply #422
Kev0, obviously it won't work the way you expecting it to, as, for example, xml parser chokes on data you are feeding it. here's the correct variant, along with a couple of other bugfixes and excessive refreshing removal kev0_tpl.rar.

foo_httpcontrol

Reply #423
Kev0, obviously it won't work the way you expecting it to, as, for example, xml parser chokes on data you are feeding it. here's the correct variant, along with a couple of other bugfixes and excessive refreshing removal kev0_tpl.rar.


Fantastic! Absolute star. Thank you very very much.

 

foo_httpcontrol

Reply #424
Hi Kev0.


I like the look of your remote, could you please tell us a little more about your setup.
Which remote are you using - is it a windows PDA/phone or an Iphone?
Which browser is supported?

Regards