IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Help with script to auto-switch output device
bsw11
post Dec 13 2010, 04:34
Post #1





Group: Members
Posts: 128
Joined: 19-April 09
From: Los Angeles CA
Member No.: 69081



I have been struggling with a problem of needing 2 different output devices depending on whether I am playing 2 channel or 5.1 channel sources. After getting an update of the ASUS driver I have eliminated the need to manually switch the ASUS and now all I need is some way to detect whether the track to be played is 2 or more channels (best case) or an .mp3 or .flac (worst case because some flacs are 2 channel) and then based on that determination set the output device to the proper setting.

Can someone please point me to a plugin that would be capable of doing this and possibly a sample script to use in the process.

Thanks!
Go to the top of the page
+Quote Post
shakey_snake
post Dec 13 2010, 05:05
Post #2





Group: FB2K Moderator
Posts: 4322
Joined: 1-November 06
From: Cincinnati
Member No.: 37036



Well, fb2k doesn't really let you switch output devices like that.


--------------------
elevatorladylevitateme
Go to the top of the page
+Quote Post
bsw11
post Dec 13 2010, 06:08
Post #3





Group: Members
Posts: 128
Joined: 19-April 09
From: Los Angeles CA
Member No.: 69081



That is too bad, however if there is a plugin that can cause even an external event of any kind (system call), then I can use something like audit to open the device page and arrow to the choice etc, so for openers can you tell me what plugin can detect the type of track that is playing?

Maybe if the developer or a hot plugin developer reads this, they can whip up something that will work.
Go to the top of the page
+Quote Post
bsw11
post Dec 13 2010, 09:32
Post #4





Group: Members
Posts: 128
Joined: 19-April 09
From: Los Angeles CA
Member No.: 69081



Progress - I have scripted autoit to change the device perfectly (2 scripts). I have foo_run installed but I don't know how to write the script in foo_run to execute the autoit scripts which once I figure that out, I can at least have 2 different function keys setup to do a quick switch.

So my 3 issues at this point are:

1 - Figure out how to make foo_run run my Autoit scripts (I can easily do this on a command line).

2 - Figure out how to execute a FB2K script at the start of play of each track

3 - Figure out how to test the number of channels in the track and then either execute the foo_run script or possible just execute my AutoIt scripts directly in this script thus eliminating the need for foo_run.

Any help would be greatly appreciated.
Go to the top of the page
+Quote Post
alkasar
post Dec 17 2010, 17:49
Post #5





Group: Members
Posts: 73
Joined: 14-November 06
Member No.: 37575



QUOTE (bsw11 @ Dec 13 2010, 09:32) *
Progress - I have scripted autoit to change the device perfectly (2 scripts). I have foo_run installed but I don't know how to write the script in foo_run to execute the autoit scripts which once I figure that out, I can at least have 2 different function keys setup to do a quick switch.

So my 3 issues at this point are:

1 - Figure out how to make foo_run run my Autoit scripts (I can easily do this on a command line).

2 - Figure out how to execute a FB2K script at the start of play of each track

3 - Figure out how to test the number of channels in the track and then either execute the foo_run script or possible just execute my AutoIt scripts directly in this script thus eliminating the need for foo_run.

Any help would be greatly appreciated.

I use autohotkey with this script. I run it from buttons via foo_run/
The script is a quick and dirty mod of the original ahk script published on HA originally for 0.9
it works great !

It would be great that the output device was part of the API so that dev could do that simple thing. But it seems foobar devs have always done, and continue to do what they want, not what we need.

CODE
;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
;
; save script in foobar folder as "outputSelection.ahk" or compile it as "outputSelection.exe"
; run script with foo_run
; for exemple C:\Program Files\foobar2000\output.ahk 0
; what is ending "0" ?
;   "0" is the first device output, if you want the 2nd
;   C:\Program Files\foobar2000\outputselection.ahk 2

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.


    SetTitleMatchMode, 2
    IfWinExist, Preferences
        Winclose
    Run, foobar2000.exe /config
        WinWait, Preferences, , 10
    
    WinActivate, Preferences            
    ControlFocus, SysTreeView321,Preferences
        
    WinGetText, win,Preferences
        IfNotInString, win, Output              
            Loop
            {send o
            WinGetText, win,Preferences
            IfInString, win, Output
            break
            }
              
ControlFocus, ComboBox1, Preferences
send, n
send, {home}
send, {Down %1%}
send, {return}

WinClose,Preferences
;Run, foobar2000.exe /stop
;Run, foobar2000.exe /play
return
Go to the top of the page
+Quote Post
alkasar
post Dec 17 2010, 17:54
Post #6





Group: Members
Posts: 73
Joined: 14-November 06
Member No.: 37575



bring back this old question


Is there an alternative to %cwb_volume% ?
Go to the top of the page
+Quote Post
shakey_snake
post Dec 17 2010, 17:56
Post #7





Group: FB2K Moderator
Posts: 4322
Joined: 1-November 06
From: Cincinnati
Member No.: 37036



No. Presumably it's not needed any more since title formatting is mostly reserved for formatting titles now, and not scripting volume widgets.

Posts merged from unrelated topic

This post has been edited by shakey_snake: Dec 17 2010, 18:05


--------------------
elevatorladylevitateme
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 3rd September 2014 - 09:20