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_lirc plugin (Read 112673 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_lirc plugin

Hello!

I want to announce foo_lirc plugin for controlling the FooBar2000 from a remote control. It is in the alpha stage of the development, but it already has the support for this features:

- configurable LIRC/WinLIRC server address and port
- supported player controls: play, pause, stop, prev.track, next track, track position and volume.

The plugin and its source code is available at SourceForge page, you may download binaries from here:
foo_lirc binary and sources

I'm waiting for comments and list of missing actions 

Screenshot

foo_lirc plugin

Reply #1
Nice, i'm going to try this with my ATI AIW tonight

foo_lirc plugin

Reply #2
I use IRMan as my IR receiver with a Sony remote.  I wish the IRMan worked WinLIRC so I could try out your plugin.  Maybe someday IRMan and WinLIRC will be able to "play together."  Does anyone know of a plugin that will work with IRMan and Foobar 8?

John

foo_lirc plugin

Reply #3
John, you may try to use the SlyControl (detailed description) program, it supports IRMan devices, and it can work as a WinLIRC server.

foo_lirc plugin

Reply #4
Thanks levsh , this should be very handy when I get around to building my UIRT2.
Quote
I'm waiting for comments and list of missing actions

What I would like to see is the ability to bind a button to any of the possible foobar actions, with an action list similar to the one in core->keyboard shortcuts. This doesn't really fit in with the code you have written already, but I think it would be a nice function to have

P.S. About the SDK, I know its possible to get the list of available actions by using service_enum_t on the menu_item class, but I'm not sure whether this would be considered a hack. Is there a more standard way to get the available actions?

foo_lirc plugin

Reply #5
thx levsh, it works well for me
yes, Phi's suggestion would be great

foo_lirc plugin

Reply #6
Quote
Nice, i'm going to try this with my ATI AIW tonight

Aha, it works fine. Marvellous job! I agree with the other comments though, it'd be nice to have all the actions available.

I might have a look at that source, too. I've been thinking of implementing a 'predictive text' style method for entering song titles in the playlist search, using the numeric keys on the AIW remote.

ta,

sean

foo_lirc plugin

Reply #7
Quote
P.S. About the SDK, I know its possible to get the list of available actions by using service_enum_t on the menu_item class, but I'm not sure whether this would be considered a hack. Is there a more standard way to get the available actions?

Using a service_enum for menu_items is a perfectly valid (and standard) way to get a list of the available commands.

foo_lirc plugin

Reply #8
Quote
Quote
P.S. About the SDK, I know its possible to get the list of available actions by using service_enum_t on the menu_item class, but I'm not sure whether this would be considered a hack. Is there a more standard way to get the available actions?

Using a service_enum for menu_items is a perfectly valid (and standard) way to get a list of the available commands.

Thanks for the clarification, foosion.

I have some similar code left over from a plugin I worked on for a while (macro commands for foobar) but never released, so I might try to implement this myself if I get some free time over the weekend.

foo_lirc plugin

Reply #9
thanks a lot for this great plugin! it is exactly what i waited for since i got an ir-reciever. 

foo_lirc plugin

Reply #10
Thanks for this plugin. This is something I've been looking for. The only thing I'd like to see added at this point would be next/prev playlist.

foo_lirc plugin

Reply #11
Quote
P.S. About the SDK, I know its possible to get the list of available actions by using service_enum_t on the menu_item class, but I'm not sure whether this would be considered a hack. Is there a more standard way to get the available actions?


It would be really helpfull if you or someone could drop me an email with a description, sample, or link to the documentation on how to do this. Right now I haven't found a good way for this.

Thanks

P.S. Really strange, I haven't received any email notifications from the forum about the messages in this thread. Any ideas?

foo_lirc plugin

Reply #12
Quote
P.S. About the SDK, I know its possible to get the list of available actions by using service_enum_t on the menu_item class, but I'm not sure whether this would be considered a hack. Is there a more standard way to get the available actions?

I haven't found any clues or sources of the Keyboard Shortcuts plugin. Correct me if I'm wrong, but from the browsing through strings of the foobar2000.exe binary I came to a conclusion that "Actions" list from the "Keyboard Shortcuts" is actually hardcoded, and not generated dynamicly. It would be great if someone from the development team could tell if I'm right 

Anyway, if this is true, the list from the "Keyboard Shorcuts" seems to be a bit too long for a remote control actions, so the list of actions to be toggled remotely is still welcome 

I'd prefere to move this discussion to the Feature Requests tracker on the sourceforge 

foo_lirc plugin

Reply #13
Quote
Quote
P.S. About the SDK, I know its possible to get the list of available actions by using service_enum_t on the menu_item class, but I'm not sure whether this would be considered a hack. Is there a more standard way to get the available actions?


It would be really helpfull if you or someone could drop me an email with a description, sample, or link to the documentation on how to do this. Right now I haven't found a good way for this.

Actually, I went ahead and implemented what I was suggesting a few days ago. It turned into almost a complete rewrite of your plugin. I didn't intend to hijack your plugin idea, but it turned out I had too much spare time on the weekend.  I'll post links to what I've done as soon as I can get to my computer at home.

Regarding how to get the list of actions, this is the code I was talking about:
Code: [Select]
    service_enum_t<menu_item> e;
   menu_item * i;
   for(i=e.first();i;i = e.next())
   {
       int m,n = i->get_num_items();
       for(m=0; m<n; m++)
       {
     string8 command;
     // You may recognise this as the menu_item::enum_item(n,string_base& out)
     //virtual function you implement when you make your own menu item
     i->enum_item(m,command);
       }
       i->service_release();
   }

service_enum_t is basically a way to enumerate through each instance of a certain object registered using a service_factory_t (or in the menu_item case menu_item_factory)

Hope I made sense there! 

foo_lirc plugin

Reply #14
Quote
I haven't found any clues or sources of the Keyboard Shortcuts plugin. Correct me if I'm wrong, but from the browsing through strings of the foobar2000.exe binary I came to a conclusion that "Actions" list from the "Keyboard Shortcuts" is actually hardcoded, and not generated dynamicly. It would be great if someone from the development team could tell if I'm right 

The "Keyboard Shortcuts" page in preferences is implemented in the core, and the list of actions is most certainly not hardcoded. As the core also implements a whole batch of commands, the names of these commands will consequently be present in the foobar2000.exe binary.

Quote
Regarding how to get the list of actions, this is the code I was talking about:

You may want to check the type of the menu item as well, i.e. whether it is a context or main menu command.

foo_lirc plugin

Reply #15
I think I'm finally ready to release my version of the plugin, so here it is...

Plugin: foo_lirc-0.2.zip
Source: foo_lirc-0.2-src.zip

Screenshot for those who are interested.

The main change is inherent support of all foobar main menu commands.

foo_lirc plugin

Reply #16
Quote
Plugin: foo_lirc-0.2.zip
Source: foo_lirc-0.2-src.zip

It would be great if you register in sourceforge, I'll give you full permissions on the foolirc project , I think it's a good idea to keep everything in one place 

foo_lirc plugin

Reply #17
Quote
Quote
Plugin: foo_lirc-0.2.zip
Source: foo_lirc-0.2-src.zip

It would be great if you register in sourceforge, I'll give you full permissions on the foolirc project , I think it's a good idea to keep everything in one place 

I agree its a good idea to keep everything in one place, but I'm (still) not too familiar with sourceforge, and I don't think I'll be able to continue development on this plugin now anyhow. Thanks for the offer though.

And obviously, you are free to use the -0.2 source however you want

foo_lirc plugin

Reply #18
Quote
Quote
Quote
Plugin: foo_lirc-0.2.zip
Source: foo_lirc-0.2-src.zip

It would be great if you register in sourceforge, I'll give you full permissions on the foolirc project , I think it's a good idea to keep everything in one place 

I agree its a good idea to keep everything in one place, but I'm (still) not too familiar with sourceforge, and I don't think I'll be able to continue development on this plugin now anyhow. Thanks for the offer though.

And obviously, you are free to use the -0.2 source however you want

Is it ok if I put your version on the Sourceforge myself then?

foo_lirc plugin

Reply #19
Quote
Is it ok if I put your version on the Sourceforge myself then?

Yes certainly, that was what I was implying but forgot to mention.

foo_lirc plugin

Reply #20
Hi,

I am using the columns_ui and if I had the lirc plugin enabled and then close foobar and reopen it i always get this error message:

I have to go to preferences and re-enable lirc support to make it work again. It happens always, note that the columns_ui has to be enabled. Is there anything you can do to fix this?

thanks in advance

foo_lirc plugin

Reply #21
No, it's a bug in foo_lirc.  The way foo_lirc finds the main window is to do this:
Code: [Select]
#define foo_window_class TEXT("{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}")
hMainWindow = FindWindow(foo_window_class, NULL);

That was how it would work in Winamp.  However, that only works with the standard user interface, since columns has a different window class.  What either Phi or levsh needs to do is to change foo_lirc to use
Code: [Select]
hMainWindow = core_api::get_main_window();

They accomplish the same thing, except the bottom one works with user interfaces other than the standard one.  In fact, I'm pretty sure the standard UI has a hard-to-recognize window class like that to discourage people from trying to use FindWindow on it.

[span style='font-size:8pt;line-height:100%'](edit):  Wording changed.[/span]

foo_lirc plugin

Reply #22
I have the same problem as Linkin, but what I noticed is that if I install another plugin, it works again. But installing another plugin again brings back the problem.
Kind of weird, maybe someone can recompile the plugin with the correct method?

foo_lirc plugin

Reply #23
Quote
Kind of weird, maybe someone can recompile the plugin with the correct method?

This same hack was fixed in my foo_gestures plugin a while ago (which I also haven't updated for quite some time ), but I didn't bother recompiling foo_lirc as I figured noone was using it.

Anyhow, I've now added the change and recompiled for foo-0.8.2. I haven't tested this, but there shouldn't be any problems.

foo_lirc-0.2.1.zip
foo_lirc-0.2.1-src.zip

foo_lirc plugin

Reply #24
thanks a lot phi!