AutoHotkey Community

It is currently May 26th, 2012, 10:35 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: June 15th, 2009, 6:03 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
What's that supposed to mean, no thanks needed. This is great! I can see you've been thinking around about this quite a bit. I haven't the time to really get into it ATM but I will this evening. Looks really good! Santa has indeed come early this year.

Notice I didn't say th@nks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2009, 3:45 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
I really like those "grips" on the right hand side. I was looking at another solution to the screen clutter, but so far I like yours better. Mine was to have a button or hotkey to redraw all the GUIs w/o titlebars, subtracting any extra width or height that the titlebars created (storing that difference) and then whenever needed, redrawing with the titlebar and the added size difference. I think your solution is extrinsically simpler, and much sexier looking. :)

Your "Choose preferred editor" dialog is really nice also Drugwash. Very professional looking stuff here.

Great work!

Things to do, for anybody interested:
    Make a todo list (done)

    Make a "add new speaker" function that adds speaker and adds them to list w/o restarting the script (I think that looks easy)

    Add an Edit box for the "Joe User" version to view speakerlog (This doesn't look so hard either, at least for a simple one.)

    Create a simple playback version using MCI commands only.

    Create recorder using MCI commands to eliminate need for external program and reduce screen clutter. I would like it to have VU meters, duration and position indicators and a systray icon that changes color when recording. (This is the tough one, and may require its own thread.)

    Add a GUI color option. For instance, that large committee setup I showed you earlier, I want to make it so the Repubs and Dems can be red and blue. (This is not a high priority, but should be easy to do nonetheless.)

There are a few ideas I'll be playing with over the next few weeks. Since you have been so incredibly helpful, everybody, I look forward to your criticism and input.

And Drugwash, if you make a better version of your own, I would sure love to see it. I don't see the "I am not worthy" emoticon here but that's about how I'm feeling. Same for Hubert and some of you others who have contributed so far. I'm continually impressed by this community.

Cheers, ribbet.1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2009, 5:14 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Resized TRC GUI, added "Add New Speaker" button. Script: http://homeofthegnome.net/AHK/meeting%20v5%20mod-3.ahk


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2009, 7:58 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Added an "autosize" function on alt-click of any GUI. If you don't like the size of the GUI, you may bring it to its default size by pressing alt and left clicking.
;-----------------------------------------------------
Edit: I think this is gone now. Pressing alt-click now adds that speaker to the attendance sheet instead.
;-----------------------------------------------------
If you resize the font for a speaker list and then use the "apply_config" button, the Guis are funny looking. But you can autosize them now. If you can show me a better way of doing this, pls do.

Code:
; http://www.autohotkey.com/forum/viewtopic.php?p=274999#274999
; modified by Drugwash June 15 2009
; re-modified by ribbet.1 so there
;This script is meant to generate a set of GUIs to create a seriatim, or a log of speakers, for the purposes of transcription.  One speaker per line,and only use letters, numbers, spaces, and periods. Lines beginning with $ are where the positions of each speaker are stored and are automatically generated by moving/resizing the GUIs to resemble a diagram of the room the speakers are located, and then pressing the Save_Config button.  You may then re-use the same speaker list and the "Apply_Config" button to immediately restore the same floor plan.

;Lines beginning with a pipe symbol (|) are comment lines and are ignored by the script. It is not recommended that you save many comments in the speaker list however.

;This version is my latest little time-wasting project, a combination of this project with another I have been using as a learning tool here at AHK forums etc.  It is TRC, or Total Recorder Controller.  The basic idea here is to create a seriatim, and essentially link it to the actual recording application.  You must have total recorder installed to use it.  For testing purposes if you like you can just download an evaluation copy.  Each line on the speaker list creates a gui.  When the one button on each gui is pressed, a variable is created which holds the current time in the recording.  When the goto or gotoplay buttons are pressed, you advance backward through these bookmarks and alternately play them back in TR.  The Resume button restarts the recording after doing so.

;When the Ctrl- button is held down while pressng a GUI button, an alternate string is sent.

;Pls. try it and report bugs at
;*******************************************************************************************
SetTitleMatchMode 2 ; otherwise it doesn't detect the window
SetTitleMatchMode Fast
SetWorkingDir := A_ScriptDir
Gui, 99:Add, GroupBox, x8 y1 w378 h260 , Settings
Gui, 99:Add, Text, x16 y15 w300 h20 +0x200, Select your preferred text editor:
Gui, 99:Add, Edit, x16 y37 w300 h20 +0x200 vmyeditor, Notepad
Gui, 99:Add, Button, x318 y37 w60 h20 gselectedit, Browse
Gui, 99:Add, Text, x16 y59 w180 h20 +0x200, Hotkey for editor's 'Refresh' function:
Gui, 99:Add, Hotkey, x199 y59 w65 h20 vehk1,
Gui, 99:Add, Hotkey, x266 y59 w50 h20 vehk2,
Gui, 99:Add, Hotkey, x318 y59 w60 h20 vehk3,
Gui, 99:Add, Text, x16 y81 w300 h20 +0x200, Select seriatim file for this event (leave blank to create new):
Gui, 99:Add, Edit, x16 y103 w300 h20 vGizmo,
Gui, 99:Add, Button, x318 y103 w60 h20 gselectser, Browse
Gui, 99:Add, Text, x16 y125 w300 h20 +0x200, Select storage path for seriatim file (leave blank for app folder):
Gui, 99:Add, Edit, x16 y147 w300 h20 vfilepath,
Gui, 99:Add, Button, x318 y147 w60 h20 gselfilepath, Browse
Gui, 99:Add, Text, x16 y169 w300 h20 +0x200, Select speaker list for this event (leave blank to create new):
Gui, 99:Add, Edit, x16 y191 w300 h20 vGomi,
Gui, 99:Add, Button, x318 y191 w60 h20 gselectspk, Browse
Gui, 99:Add, Text, x16 y213 w300 h20 +0x200, Select storage path for speaker list (leave blank for app folder):
Gui, 99:Add, Edit, x16 y235 w300 h20 vspkpath,
Gui, 99:Add, Button, x318 y235 w60 h20 gselspkpath, Browse
Gui, 99:Add, Text, x16 y267 w180 h30 +Center +Border +Border, Place for name && version,`npicture logo, etc.
Gui, 99:Add, Button, x206 y267 w110 h30 , &Run
Gui, 99:Add, Button, x318 y267 w60 h30 , E&xit
Gui, 99:+OwnDialogs
Gui, 99:Show, x350 y160 h305 w395, Settings
Return

selectedit:
FileSelectFile, myeditor, 3,, Select your preferred text editor (leave blank for default):, Application (*.exe)
IfNotExist, %myeditor%
   myeditor = Notepad
GuiControl,99:, myeditor, %myeditor%
return

selectser:
FileSelectFile, Gizmo, 3,, Select seriatim file for this event (leave blank to create new):, Text file (*.txt)
IfNotExist, %Gizmo%
   Gizmo = %A_MM%-%A_DD%.txt
GuiControl,99:, Gizmo, %Gizmo%
return

selectspk:
FileSelectFile, Gomi, 3,, Select speaker list for this event (leave blank to create new):, Text file (*.txt)
IfNotExist, %Gomi%
   {
   neededit=1
   Gomi = 00Speakerlist%A_MM%%A_DD%%A_Hour%%A_Min%.txt
   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates a generic speaker list
   }
GuiControl,99:, Gomi, %Gomi%
return

selfilepath:
FileSelectFolder, filepath, *%A_WorkingDir%, 3, Select storage path for seriatim file (leave blank for app folder):
IfNotExist, %filepath%
   filepath := A_WorkingDir
filepath := RegExReplace(filepath, "\\$")
GuiControl,99:, filepath, %filepath%
return

selspkpath:
FileSelectFolder, spkpath, *%A_WorkingDir%, 3, Select storage path for speaker list (leave blank for app folder):
IfNotExist, %spkpath%
   spkpath := A_WorkingDir
spkpath := RegExReplace(spkpath, "\\$")
GuiControl,99:, spkpath, %spkpath%
return

99ButtonExit:
99GuiClose:
ExitApp

99ButtonRun:
Gui, 99:-OwnDialogs
Gui, 99:Submit ; needs double-check for filename/path errors
IfNotExist, %Gizmo%
   Gizmo = %A_MM%-%A_DD%.txt
IfNotExist, %Gomi%
   {
   neededit=1
   Gomi = 00Speakerlist%A_MM%%A_DD%%A_Hour%%A_Min%.txt
   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates a generic speaker list
   }
IfNotExist, %myeditor%
   myeditor = Notepad

refresh := (ehk1 ? "{" ehk1 "}" : "") . (ehk2 ? "{" ehk2 "}" : "") . (ehk3 ? "{" ehk3 "}" : "")
Loop, %Gizmo%
   FileMove, %Gizmo%, filepath "\" A_LoopFileName
Loop, %Gomi%
   FileMove, %Gomi%, spkpath "\"  A_LoopFileName
Rosie =
nn =
grip=15 ; width of blue grip to the right of the speaker labels
if neededit
   {
   Msgbox,%Gomi% is your speaker list.  Start by changing the examples to your actual speakers.  You may add as many as you wish.  Make them one name per line only. Numbers and Letters only`, no commas`,colons`, semicolons or any other funny business.  Periods are allowed. You may always revise the list and restart the program again too. Pls. note that one called `"table`" has no button and can be shaped and resized to resemble oh, say, a table.  You may create buttonless GUIs for this purpose by prefixing their name with the `"`@`" symbol.
   RunWait, %myeditor% %Gomi%
   Sleep, 1000   ; allow the OS to save the file properly
   }
MsgBox,You will need to turn on `"append mode under `"Record`/Play`" on the toolbar menu`, and you will also need to select `"show sound image`" either `"in panel`" or `"in separate window.`"  It is presumed that you have a working knowledge of Total Recorder prior to using this.  If so`, now would be a good time to start the recording.  If not`, you should exit this program and go learn your way around TR before trying this.

IfWinExist,ahk_class TotalRecorderWndClass
WinActivate,ahk_class TotalRecorderWndClass
;*******************************************************************************************
SplitPath,Gomi,Omig

Topper = 1
Gui, 1:Margin, 0, 0
Gui, 1:Add, Button, x0 y0 w80 h24 , Record
Gui, 1:Add, Button, x80 y00 w80 h24 , Resume
Gui, 1:Add, Button, x0 y24 w80 h24 , Q
Gui, 1:Add, Button, x80 y24 w80 h24 , A
Gui, 1:Add, Button, x0 y48 w80 h24 , Save_Config
Gui, 1:Add, Button, x80 y48 w80 h24 , Apply_Config
Gui, 1:Add, Button, x0 y72 w80 h24 , Goto
Gui, 1:Add, Button, x80 y72 w80 h24 , Goto_play
Gui, 1:Add, Button, x0 y96 w80 h24 , View_log
Gui, 1:Add, Button, x80 y96 w80 h24 , Speakerlist
Gui, 1:Add, Button, x0 y120 w80 h24 , Bookmark
Gui, 1:Add, Button, x80 y120 w80 h24 , Query
Gui, 1:Add, Button, x0 y144 w40 h24 , <<
Gui, 1:Add, Button, x40 y144 w40 h24 , <
Gui, 1:Add, Button, x80 y144 w40 h24 , >
Gui, 1:Add, Button, x120 y144 w40 h24 , >>
Gui, 1:Add, Button, x0 y168 w80 h24 , Reload
Gui, 1:Add, Button, x80 y168 w80 h24 ,Toggle_TR
Gui, 1:Add, Button, x80 y192 w80 h24 ,Add_Speaker
Gui, 1:+AlwaysOnTop
; Generated using SmartGUI Creator 4.0
Gui, 1:Show,x0 y0, TRC
Gui, 1:+Default

M%Topper% = TRC

Loop
{
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   IfInString,Boy,|
   Continue
   IfInString,Boy,$
   Break
   If Boy =
   Continue
   IfInString,Boy,`&
      {
      StringReplace,Boy,Boy,`&,,All
      Kramer = %Boy%
      Continue
      }
   Topper++
   Goy = %Boy%
   Boy = %Goy%
   Gui,%Topper%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%Topper%:-SysMenu
   Gui,%Topper%:Margin,0,0
   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
     Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:+LabelTable +MinSize50x40
   Gui, %Topper%:Add, Picture, w50 h50 gmoveit, %A_ScriptDir%\tbl.bmp
    Gui, %Topper%:Add,Text, x1 y1 cWhite BackgroundTrans Center,%Boy%
   Gui, %Topper%:Show,x200 y0,%Boy%
        M%Topper% = %Boy%
        Continue
     }
   Gui, %Topper%:+LabelSpkr
   Gui, %Topper%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:Add,Button, x0 y0 gButtonSpeaker ,%Boy%
   Gui, %Topper%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %Topper%:Show,x200 y0,%Boy%
   M%Topper% = %Boy%
}

FileAppend,`r`n`[Script started %A_MM%-%A_DD%-%A_Hour%:%A_Min%:%A_Sec%`]`r`n,%Gizmo%

Run %myeditor% %Gizmo%

Return

TableSize:
GuiControl, %A_Gui%:MoveDraw, Static1, x0, y0, w%A_GuiWidth%, h%A_GuiHeight%
GuiControl, %A_Gui%:MoveDraw, Static2, x0, y0, w%A_GuiWidth%
return

SpkrSize:
nx := A_GuiWidth-grip
GuiControl, %A_Gui%:MoveDraw, Static1, x%nx%, y0, w%grip%, h%A_GuiHeight%
GuiControl, %A_Gui%:MoveDraw, Button1, x0, y0, w%nx% , h%A_GuiHeight%
return

moveit:
PostMessage, 0xA1, 2,,, A ; this allows dragging a window by any spot ;-)
return

ButtonSpeaker:
GetKeyState,ByB,Alt
If ByB = D
{
;WinActivate %A_Gui%
Jont := % M%A_Gui%
WinGetPos,vv,bb,,,%Jont%
Gui, %A_Gui%:Destroy
   Gui,%A_Gui%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %A_Gui%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%A_Gui%:-SysMenu
   Gui,%A_Gui%:Margin,0,0
   Gui, %A_Gui%:+LabelSpkr
   Gui, %A_Gui%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %A_Gui%:Add,Button, x0 y0 gButtonSpeaker ,%Jont%
   Gui, %A_Gui%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %A_Gui%:Show, x%vv% y%bb% ,%Jont%
Return
}
If A_Gui = 1
{
Gosub Button%Speaker%
Sleep,50
Goto Scrapple
}
Else

GetKeyState,ByA,Ctrl
If ByA = D
{
 ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[ %Timex% - %timey% `]%A_Tab%%A_Tab%BY%A_Space%,%Gizmo%
 FileAppend,% M%A_Gui% ":",%Gizmo%
}
Else
{
 ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[ %Timex% - %timey% `],%Gizmo%
 FileAppend,% M%A_Gui%,%Gizmo%
 FileAppend,:*.%A_Space%, %Gizmo%
}
 Rosie++
 R%Rosie% := Timex
 Pinky = %Rosie%
 Goto Scrapple
 
^+#Escape::ExitApp

;-----------------------------------------------------

ButtonSave_Config:

Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   StringReplace,FancyPants,A_LoopReadLine,`n,,All
   StringReplace,FancyPants,FancyPants,`r,,All
   StringReplace,FancyPants,FancyPants,`,,``,,All
   IfInString,FancyPants,$
   Continue
   FileAppend,%FancyPants%`r`n
}
Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   IfInString,A_LoopReadLine,|
   Continue
   IfInString,A_LoopReadLine,$
   Continue
   IfInString,A_LoopReadLine,`&
   Continue
   Autotrim,On
   FancyPants = %A_LoopReadLine%
   StringReplace,FancyPants,FancyPants,@,,All
   WinGetPos,xx,yy,ww,hh,%FancyPants%
   FileAppend,$%FancyPants%`,%xx%`,%yy%`,%ww%`,%hh%`r`n
}
WinGetPos,xx,yy,ww,hh,TRC
FileAppend,$TRC`,%xx%`,%yy%`,%ww%`,%hh%`r`n,deleme.txt

WinGetPos,xx,yy,,,ahk_class TotalRecorderWndClass
FileAppend,$ahk_class TotalRecorderWndClass`,%xx%`,%yy%`,`,`r`n,deleme.txt

FileMove,deleme.txt,%Gomi%,1
FileAppend,`r`n,%Gomi%

Return

ButtonApply_Config: ;;This reads all lines containing "$" and moves the GUIs to those positions.
Loop
{
   FileReadLine,Troy,%Gomi%,%A_Index%
      If Troy =
   Break
   IfInString,Troy,$
      {
      StringSplit,aa,Troy,`,,$
      WinMove,%aa1%,,%aa2%,%aa3%,%aa4%,%aa5%
      }
}
Return
;-----------------------------------------------------

;TRC stuff follows

;-----------------------------------------------------
Pause::Suspend
;-----------------------------------------------------

ButtonQuery:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey%-00QUERY`]
goto commonsub

ButtonQ:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey% `]Q*.%A_Space%
goto commonsub

ButtonA:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey% `]A*.%A_Space%
goto commonsub

ButtonBookmark:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
; shouldn't this have a newline prepended ??? I added one, just in case
stringtolog = `n*.%A_Space%[ %Timex% -%timey%--00Marker`]
commonsub:
Rosie++
FileAppend, %stringtolog%,%Gizmo%
R%Rosie% := Timex
Pinky = %Rosie%
Goto Scrapple

ButtonRecord:
;nn = 1
;Rosie++
Disney = 1
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
ControlClick,Button14,ahk_class TotalRecorderWndClass
R%Rosie% = %Timex%
;FormatTime, timey,, HH:mm:ss
FileAppend, `r`n`[Recording Begin %Timex% -%timey%`],%Gizmo%
ControlClick,Button20,ahk_class TotalRecorderWndClass
;Pinky = %Rosie%
WinSet,AlwaysOnTop,Off,ahk_class TotalRecorderWndClass
Return

ButtonGoto_Play:
WinSet,AlwaysOnTop,On,ahk_class TotalRecorderWndClass
If Disney <>
{
WinActivate,Total Recorder
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex% -%timey%`],%Gizmo%
}
Gosub, Backup
Sleep,50
ControlClick,Button16,ahk_class TotalRecorderWndClass
Disney =
Return

ButtonGoto:
WinSet,AlwaysOnTop,On,ahk_class TotalRecorderWndClass
If Disney <>
{
WinActivate,Total Recorder
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex% -%timey%`],%Gizmo%
Pinky = %Rosie%
}
Gosub, Backup
Disney =
Return

Backup:
Pinky--
if Pinky < 0
   return   ; otherwise it throws an error
Rnn := R%Pinky%
ControlClick,Button19,ahk_class TotalRecorderWndClass
Sleep,50
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
Sleep,50
ControlSetText,Edit1,%Rnn%,Jump to time
Sleep,50
ControlClick,Button3,Jump to time
Sleep,30
If Pinky = 1
{
Msgbox,,2,Out of bookmarks!,.5
Pinky = %Rosie%
}
Return

JumpBox:
^+j::
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
Return

ButtonView_log:
SetTitleMatchMode,1
IfWinNotExist,%Gizmo%
{
Run %myeditor% %Gizmo%
WinWaitActive,%Gizmo%
ControlSend,,^{End},%Gizmo%
Return
}
Else
WinKill,%Gizmo%
Return

ButtonSpeakerlist:
IfWinNotExist,%Omig%
{
Run %myeditor% %Gomi%
WinWaitActive,%Omig%
ControlSend,,^{End},%Omig%
Return
}
Else
WinKill,%Omig%
Return


ButtonResume:
nn = 1
Disney = 1
ControlClick,Button14,ahk_class TotalRecorderWndClass
Sleep,10
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Resume %Timex% -%timey%`],%Gizmo%
ControlClick,Button20,ahk_class TotalRecorderWndClass
WinSet,AlwaysOnTop,Off,ahk_class TotalRecorderWndClass
Gosub,Scrapple
Return

^#c:: ;;This sends highlighted text to the TR jumpbox and presses OK
Send,^c
Bubba := Clipboard
ControlClick,Button19,ahk_class TotalRecorderWndClass
Sleep,300
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
ControlSetText,Edit1,%Bubba%,Jump to time
ControlClick,Button3,Jump to time
Return

Button<<:
ControlClick,Button11,ahk_class TotalRecorderWndClass
Return

Button<:
ControlClick,Button12,ahk_class TotalRecorderWndClass
Return

Button>:
ControlClick,Button13,ahk_class TotalRecorderWndClass
Return

Button>>:
ControlClick,Button14,ahk_class TotalRecorderWndClass
Return


ButtonReload:
^+#Backspace:
Reload
Return

ButtonToggle_TR:
^+#t::  ;;toggle TR to front and back
Abby++
If Abby = 1
   {
   WinSet,AlwaysOnTop,ON,ahk_class TotalRecorderWndClass
   WinActivate,ahk_class TotalRecorderWndClass
   Return
   }
Else
   {
   WinSet,AlwaysOnTop,Off,ahk_class TotalRecorderWndClass
   WinActivate,ahk_class TotalRecorderWndClass
   Gosub,Scrapple
   If Abby > 1
   Abby = 0
   }
Return

Scrapple:
IfWinNotExist,%Gizmo%
{
Run %myeditor% %Gizmo%
WinWaitActive,%Gizmo%
ControlSend,,^{End},%Gizmo%
Return
}
Else if refresh
   {
   WinActivate, %Gizmo%
   WinWaitActive, %Gizmo%
   SendInput %refresh%
   }
Else
{
WinKill,%Gizmo%
Run %myeditor% %Gizmo%
}
WinWaitActive,%Gizmo%
ControlSend,,^{End}, %Gizmo%
Return

ButtonAdd_Speaker:
InputBox,Nu,Add New Speaker,Pls. Type Name for Speaker ID. Prefix it with a "@" symbol to add a fixture such as a table.
FileAppend,`r`n%Nu%,%Gomi%
   Topper++
   Goy = %Nu%
   Boy = %Goy%
   Gui,%Topper%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%Topper%:-SysMenu
   Gui,%Topper%:Margin,0,0
   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
        Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:+LabelTable +MinSize50x40
   Gui, %Topper%:Add, Picture, w50 h50 gmoveit, %A_ScriptDir%\tbl.bmp
    Gui, %Topper%:Add,Text, x1 y1 cWhite BackgroundTrans Center,%Boy%
   Gui, %Topper%:Show,x200 y0,%Boy%
        M%Topper% = %Boy%
        Return
     }
   Gui, %Topper%:+LabelSpkr
   Gui, %Topper%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:Add,Button, x0 y0 gButtonSpeaker ,%Boy%
   Gui, %Topper%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %Topper%:Show,x200 y0,%Boy%
   M%Topper% = %Boy%
Return



Last edited by ribbet.1 on September 12th, 2009, 12:57 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2009, 5:44 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
OK I thunk I got this right. Added a function to resize fonts on all the Guis, and then autosize them all, ignoring the furniture guis. ^#!up and ^#!down in/decrement the font size. The font size is not stored with the speaker list until you save config however.

This is useful when you want to arrange your speakers in a speakerlist, and want the buttons as big as can reasonably fit the space you've allotted on your desktop.

Also, added a "redraw" button, which autosizes all speaker guis, ignoring the furniture guis.

Pls. point out any errors or suggested improvements here.

Code:
; http://www.autohotkey.com/forum/viewtopic.php?p=274999#274999
; modified by Drugwash June 15 2009
; re-modified by ribbet.1 so there
;This script is meant to generate a set of GUIs to create a seriatim, or a log of speakers, for the purposes of transcription.  One speaker per line,and only use letters, numbers, spaces, and periods. Lines beginning with $ are where the positions of each speaker are stored and are automatically generated by moving/resizing the GUIs to resemble a diagram of the room the speakers are located, and then pressing the Save_Config button.  You may then re-use the same speaker list and the "Apply_Config" button to immediately restore the same floor plan.

;Lines beginning with a pipe symbol (|) are comment lines and are ignored by the script. It is not recommended that you save many comments in the speaker list however.

;This version is my latest little time-wasting project, a combination of this project with another I have been using as a learning tool here at AHK forums etc.  It is TRC, or Total Recorder Controller.  The basic idea here is to create a seriatim, and essentially link it to the actual recording application.  You must have total recorder installed to use it.  For testing purposes if you like you can just download an evaluation copy.  Each line on the speaker list creates a gui.  When the one button on each gui is pressed, a variable is created which holds the current time in the recording.  When the goto or gotoplay buttons are pressed, you advance backward through these bookmarks and alternately play them back in TR.  The Resume button restarts the recording after doing so.

;When the Ctrl- button is held down while pressng a GUI button, an alternate string is sent.

;Pls. try it and report bugs at
;*******************************************************************************************
SetTitleMatchMode 2 ; otherwise it doesn't detect the window
SetTitleMatchMode Fast
SetWorkingDir := A_ScriptDir
Gui, 99:Add, GroupBox, x8 y1 w378 h260 , Settings
Gui, 99:Add, Text, x16 y15 w300 h20 +0x200, Select your preferred text editor:
Gui, 99:Add, Edit, x16 y37 w300 h20 +0x200 vmyeditor, Notepad
Gui, 99:Add, Button, x318 y37 w60 h20 gselectedit, Browse
Gui, 99:Add, Text, x16 y59 w180 h20 +0x200, Hotkey for editor's 'Refresh' function:
Gui, 99:Add, Hotkey, x199 y59 w65 h20 vehk1,
Gui, 99:Add, Hotkey, x266 y59 w50 h20 vehk2,
Gui, 99:Add, Hotkey, x318 y59 w60 h20 vehk3,
Gui, 99:Add, Text, x16 y81 w300 h20 +0x200, Select seriatim file for this event (leave blank to create new):
Gui, 99:Add, Edit, x16 y103 w300 h20 vGizmo,
Gui, 99:Add, Button, x318 y103 w60 h20 gselectser, Browse
Gui, 99:Add, Text, x16 y125 w300 h20 +0x200, Select storage path for seriatim file (leave blank for app folder):
Gui, 99:Add, Edit, x16 y147 w300 h20 vfilepath,
Gui, 99:Add, Button, x318 y147 w60 h20 gselfilepath, Browse
Gui, 99:Add, Text, x16 y169 w300 h20 +0x200, Select speaker list for this event (leave blank to create new):
Gui, 99:Add, Edit, x16 y191 w300 h20 vGomi,
Gui, 99:Add, Button, x318 y191 w60 h20 gselectspk, Browse
Gui, 99:Add, Text, x16 y213 w300 h20 +0x200, Select storage path for speaker list (leave blank for app folder):
Gui, 99:Add, Edit, x16 y235 w300 h20 vspkpath,
Gui, 99:Add, Button, x318 y235 w60 h20 gselspkpath, Browse
Gui, 99:Add, Text, x16 y267 w180 h30 +Center +Border +Border, Place for name && version,`npicture logo, etc.
Gui, 99:Add, Button, x206 y267 w110 h30 , &Run
Gui, 99:Add, Button, x318 y267 w60 h30 , E&xit
Gui, 99:+OwnDialogs
Gui, 99:Show, x350 y160 h305 w395, Settings
Return

selectedit:
FileSelectFile, myeditor, 3,, Select your preferred text editor (leave blank for default):, Application (*.exe)
IfNotExist, %myeditor%
   myeditor = Notepad
GuiControl,99:, myeditor, %myeditor%
return

selectser:
FileSelectFile, Gizmo, 3,, Select seriatim file for this event (leave blank to create new):, Text file (*.txt)
IfNotExist, %Gizmo%
   Gizmo = %A_MM%-%A_DD%.txt
GuiControl,99:, Gizmo, %Gizmo%
return

selectspk:
FileSelectFile, Gomi, 3,, Select speaker list for this event (leave blank to create new):, Text file (*.txt)
IfNotExist, %Gomi%
   {
   neededit=1
   Gomi = 00Speakerlist%A_MM%%A_DD%%A_Hour%%A_Min%.txt
   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates a generic speaker list
   }
GuiControl,99:, Gomi, %Gomi%
return

selfilepath:
FileSelectFolder, filepath, *%A_WorkingDir%, 3, Select storage path for seriatim file (leave blank for app folder):
IfNotExist, %filepath%
   filepath := A_WorkingDir
filepath := RegExReplace(filepath, "\\$")
GuiControl,99:, filepath, %filepath%
return

selspkpath:
FileSelectFolder, spkpath, *%A_WorkingDir%, 3, Select storage path for speaker list (leave blank for app folder):
IfNotExist, %spkpath%
   spkpath := A_WorkingDir
spkpath := RegExReplace(spkpath, "\\$")
GuiControl,99:, spkpath, %spkpath%
return

99ButtonExit:
99GuiClose:
ExitApp

99ButtonRun:
Gui, 99:-OwnDialogs
Gui, 99:Submit ; needs double-check for filename/path errors
IfNotExist, %Gizmo%
   Gizmo = %A_MM%-%A_DD%.txt
IfNotExist, %Gomi%
   {
   neededit=1
   Gomi = 00Speakerlist%A_MM%%A_DD%%A_Hour%%A_Min%.txt
   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates a generic speaker list
   }
IfNotExist, %myeditor%
   myeditor = Notepad

refresh := (ehk1 ? "{" ehk1 "}" : "") . (ehk2 ? "{" ehk2 "}" : "") . (ehk3 ? "{" ehk3 "}" : "")
Loop, %Gizmo%
   FileMove, %Gizmo%, filepath "\" A_LoopFileName
Loop, %Gomi%
   FileMove, %Gomi%, spkpath "\"  A_LoopFileName
Rosie =
nn =
grip=15 ; width of blue grip to the right of the speaker labels
if neededit
   {
   Msgbox,%Gomi% is your speaker list.  Start by changing the examples to your actual speakers.  You may add as many as you wish.  Make them one name per line only. Numbers and Letters only`, no commas`,colons`, semicolons or any other funny business.  Periods are allowed. You may always revise the list and restart the program again too. Pls. note that one called `"table`" has no button and can be shaped and resized to resemble oh, say, a table.  You may create buttonless GUIs for this purpose by prefixing their name with the `"`@`" symbol.
   RunWait, %myeditor% %Gomi%
   Sleep, 1000   ; allow the OS to save the file properly
   }
MsgBox,You will need to turn on `"append mode under `"Record`/Play`" on the toolbar menu`, and you will also need to select `"show sound image`" either `"in panel`" or `"in separate window.`"  It is presumed that you have a working knowledge of Total Recorder prior to using this.  If so`, now would be a good time to start the recording.  If not`, you should exit this program and go learn your way around TR before trying this.

IfWinExist,ahk_class TotalRecorderWndClass
WinActivate,ahk_class TotalRecorderWndClass
;*******************************************************************************************
SplitPath,Gomi,Omig

Topper = 1
Gui, 1:Margin, 0, 0
Gui, 1:Add, Button, x0 y0 w80 h24 , Record
Gui, 1:Add, Button, x80 y00 w80 h24 , Resume
Gui, 1:Add, Button, x0 y24 w80 h24 , Q
Gui, 1:Add, Button, x80 y24 w80 h24 , A
Gui, 1:Add, Button, x0 y48 w80 h24 , Save_Config
Gui, 1:Add, Button, x80 y48 w80 h24 , Apply_Config
Gui, 1:Add, Button, x0 y72 w80 h24 , Goto
Gui, 1:Add, Button, x80 y72 w80 h24 , Goto_play
Gui, 1:Add, Button, x0 y96 w80 h24 , View_log
Gui, 1:Add, Button, x80 y96 w80 h24 , Speakerlist
Gui, 1:Add, Button, x0 y120 w80 h24 , Bookmark
Gui, 1:Add, Button, x80 y120 w80 h24 , Query
Gui, 1:Add, Button, x0 y144 w40 h24 , <<
Gui, 1:Add, Button, x40 y144 w40 h24 , <
Gui, 1:Add, Button, x80 y144 w40 h24 , >
Gui, 1:Add, Button, x120 y144 w40 h24 , >>
Gui, 1:Add, Button, x0 y168 w80 h24 , Reload
Gui, 1:Add, Button, x80 y168 w80 h24 ,Toggle_TR
Gui, 1:Add, Button, x0 y192 w80 h24 ,Add_Speaker
Gui, 1:Add, Button, x80 y192 w80 h24 ,Redraw
Gui, 1:+AlwaysOnTop
; Generated using SmartGUI Creator 4.0
Gui, 1:Show,x0 y0, TRC
Gui, 1:+Default

M%Topper% = TRC

Loop
{
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   IfInString,Boy,|
   Continue
   IfInString,Boy,$
   Break
   If Boy =
   Continue
   IfInString,Boy,`&
      {
      StringReplace,Boy,Boy,`&,,All
      Kramer = %Boy%
    eBoy = 1
      Continue
      }
   Topper++
   Goy = %Boy%
   Boy = %Goy%
   Gui,%Topper%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%Topper%:-SysMenu
   Gui,%Topper%:Margin,0,0

   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
     Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:+LabelTable +MinSize50x40
   Gui, %Topper%:Add, Picture, w50 h50 gmoveit, %A_ScriptDir%\tbl.bmp
    Gui, %Topper%:Add,Text, x1 y1 cWhite BackgroundTrans Center,%Boy%
   Gui, %Topper%:Show,x200 y0,%Boy%
        N%Topper% = %Boy%
        Continue
     }
   Gui, %Topper%:+LabelSpkr
   Gui, %Topper%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:Add,Button, x0 y0 gButtonSpeaker ,%Boy%
   Gui, %Topper%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %Topper%:Show,x200 y0,%Boy%
   M%Topper% = %Boy%
}

FileAppend,`r`n`[Script started %A_MM%-%A_DD%-%A_Hour%:%A_Min%:%A_Sec%`]`r`n,%Gizmo%

Run %myeditor% %Gizmo%

Return

TableSize:
GuiControl, %A_Gui%:MoveDraw, Static1, x0, y0, w%A_GuiWidth%, h%A_GuiHeight%
GuiControl, %A_Gui%:MoveDraw, Static2, x0, y0, w%A_GuiWidth%
return

SpkrSize:
nx := A_GuiWidth-grip
GuiControl, %A_Gui%:MoveDraw, Static1, x%nx%, y0, w%grip%, h%A_GuiHeight%
GuiControl, %A_Gui%:MoveDraw, Button1, x0, y0, w%nx% , h%A_GuiHeight%
return

moveit:
PostMessage, 0xA1, 2,,, A ; this allows dragging a window by any spot ;-)
return

ButtonSpeaker:
GetKeyState,ByB,Alt

If ByB = D
{
Jont := % M%A_Gui%
WinGetPos,vv,bb,,,%Jont%
Gui, %A_Gui%:Destroy
   Gui,%A_Gui%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %A_Gui%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%A_Gui%:-SysMenu
   Gui,%A_Gui%:Margin,0,0
   Gui, %A_Gui%:+LabelSpkr
   Gui, %A_Gui%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %A_Gui%:Add,Button, x0 y0 gButtonSpeaker ,%Jont%
   Gui, %A_Gui%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %A_Gui%:Show, x%vv% y%bb% ,%Jont%
Return
}
If A_Gui = 1
{
Gosub Button%Speaker%
Sleep,50
Goto Scrapple
}
Else

GetKeyState,ByA,Ctrl
If ByA = D
{
 ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[ %Timex% - %timey% `]%A_Tab%%A_Tab%BY%A_Space%,%Gizmo%
 FileAppend,% M%A_Gui% ":",%Gizmo%
}
Else
{
 ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[ %Timex% - %timey% `],%Gizmo%
 FileAppend,% M%A_Gui%,%Gizmo%
 FileAppend,:*.%A_Space%, %Gizmo%
}
 Rosie++
 R%Rosie% := Timex
 Pinky = %Rosie%
 Goto Scrapple
 
^+#Escape::ExitApp

;-----------------------------------------------------

ButtonSave_Config:

Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   StringReplace,FancyPants,A_LoopReadLine,`n,,All
   StringReplace,FancyPants,FancyPants,`r,,All
   StringReplace,FancyPants,FancyPants,`,,``,,All
   IfInString,FancyPants,$
   Continue
   IfInString,FancyPants,`&
   {
   FancyPants = `&%Kramer%
   Moto = 1
   }
   FileAppend,%FancyPants%`r`n

}
Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   IfInString,A_LoopReadLine,|
   Continue
   IfInString,A_LoopReadLine,$
   Continue
   IfInString,A_LoopReadLine,`&
   Continue
   Autotrim,On
   FancyPants = %A_LoopReadLine%
   StringReplace,FancyPants,FancyPants,@,,All
   WinGetPos,xx,yy,ww,hh,%FancyPants%
   FileAppend,$%FancyPants%`,%xx%`,%yy%`,%ww%`,%hh%`r`n
}
WinGetPos,xx,yy,ww,hh,TRC
FileAppend,$TRC`,%xx%`,%yy%`,%ww%`,%hh%`r`n,deleme.txt

WinGetPos,xx,yy,,,ahk_class TotalRecorderWndClass
FileAppend,$ahk_class TotalRecorderWndClass`,%xx%`,%yy%`,`,`r`n,deleme.txt

If Moto =
If Kramer =
FileAppend,`&12,deleme.txt
Else
FileAppend,`&%Kramer%,deleme.txt
FileAppend,`r`n,deleme.txt

FileMove,deleme.txt,%Gomi%,1


Return

ButtonApply_Config: ;;This reads all lines containing "$" and moves the GUIs to those positions.
Loop
{
   FileReadLine,Troy,%Gomi%,%A_Index%
      If Troy =
   Break

   IfInString,Troy,$
      {
      StringSplit,aa,Troy,`,,$
      WinMove,%aa1%,,%aa2%,%aa3%,%aa4%,%aa5%
      }
}
Return
;-----------------------------------------------------

;TRC stuff follows

;-----------------------------------------------------
Pause::Suspend
;-----------------------------------------------------

ButtonQuery:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey%-00QUERY`]
goto commonsub

ButtonQ:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey% `]Q*.%A_Space%
goto commonsub

ButtonA:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey% `]A*.%A_Space%
goto commonsub

ButtonBookmark:
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
; shouldn't this have a newline prepended ??? I added one, just in case
stringtolog = `n*.%A_Space%[ %Timex% -%timey%--00Marker`]
commonsub:
Rosie++
FileAppend, %stringtolog%,%Gizmo%
R%Rosie% := Timex
Pinky = %Rosie%
Goto Scrapple

ButtonRecord:
;nn = 1
;Rosie++
Disney = 1
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
ControlClick,Button14,ahk_class TotalRecorderWndClass
R%Rosie% = %Timex%
;FormatTime, timey,, HH:mm:ss
FileAppend, `r`n`[Recording Begin %Timex% -%timey%`],%Gizmo%
ControlClick,Button20,ahk_class TotalRecorderWndClass
;Pinky = %Rosie%
WinSet,AlwaysOnTop,Off,ahk_class TotalRecorderWndClass
Return

ButtonGoto_Play:
WinSet,AlwaysOnTop,On,ahk_class TotalRecorderWndClass
If Disney <>
{
WinActivate,Total Recorder
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex% -%timey%`],%Gizmo%
}
Gosub, Backup
Sleep,50
ControlClick,Button16,ahk_class TotalRecorderWndClass
Disney =
Return

ButtonGoto:
WinSet,AlwaysOnTop,On,ahk_class TotalRecorderWndClass
If Disney <>
{
WinActivate,Total Recorder
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex% -%timey%`],%Gizmo%
Pinky = %Rosie%
}
Gosub, Backup
Disney =
Return

Backup:
Pinky--
if Pinky < 0
   return   ; otherwise it throws an error
Rnn := R%Pinky%
ControlClick,Button19,ahk_class TotalRecorderWndClass
Sleep,50
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
Sleep,50
ControlSetText,Edit1,%Rnn%,Jump to time
Sleep,50
ControlClick,Button3,Jump to time
Sleep,30
If Pinky = 1
{
Msgbox,,2,Out of bookmarks!,.5
Pinky = %Rosie%
}
Return

JumpBox:
^+j::
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
Return

ButtonView_log:
SetTitleMatchMode,1
IfWinNotExist,%Gizmo%
{
Run %myeditor% %Gizmo%
WinWaitActive,%Gizmo%
ControlSend,,^{End},%Gizmo%
Return
}
Else
WinKill,%Gizmo%
Return

ButtonSpeakerlist:
IfWinNotExist,%Omig%
{
Run %myeditor% %Gomi%
WinWaitActive,%Omig%
ControlSend,,^{End},%Omig%
Return
}
Else
WinKill,%Omig%
Return


ButtonResume:
nn = 1
Disney = 1
ControlClick,Button14,ahk_class TotalRecorderWndClass
Sleep,10
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Resume %Timex% -%timey%`],%Gizmo%
ControlClick,Button20,ahk_class TotalRecorderWndClass
WinSet,AlwaysOnTop,Off,ahk_class TotalRecorderWndClass
Gosub,Scrapple
Return

^#c:: ;;This sends highlighted text to the TR jumpbox and presses OK
Send,^c
Bubba := Clipboard
ControlClick,Button19,ahk_class TotalRecorderWndClass
Sleep,300
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
ControlSetText,Edit1,%Bubba%,Jump to time
ControlClick,Button3,Jump to time
Return

Button<<:
ControlClick,Button11,ahk_class TotalRecorderWndClass
Return

Button<:
ControlClick,Button12,ahk_class TotalRecorderWndClass
Return

Button>:
ControlClick,Button13,ahk_class TotalRecorderWndClass
Return

Button>>:
ControlClick,Button14,ahk_class TotalRecorderWndClass
Return


ButtonReload:
^+#Backspace:
Reload
Return

ButtonToggle_TR:
^+#t::  ;;toggle TR to front and back
Abby++
If Abby = 1
   {
   WinSet,AlwaysOnTop,ON,ahk_class TotalRecorderWndClass
   WinActivate,ahk_class TotalRecorderWndClass
   Return
   }
Else
   {
   WinSet,AlwaysOnTop,Off,ahk_class TotalRecorderWndClass
   WinActivate,ahk_class TotalRecorderWndClass
   Gosub,Scrapple
   If Abby > 1
   Abby = 0
   }
Return

Scrapple:
IfWinNotExist,%Gizmo%
{
Run %myeditor% %Gizmo%
WinWaitActive,%Gizmo%
ControlSend,,^{End},%Gizmo%
Return
}
Else if refresh
   {
   WinActivate, %Gizmo%
   WinWaitActive, %Gizmo%
   SendInput %refresh%
   }
Else
{
WinKill,%Gizmo%
Run %myeditor% %Gizmo%
}
WinWaitActive,%Gizmo%
ControlSend,,^{End}, %Gizmo%
Return

ButtonAdd_Speaker:
InputBox,Nu,Add New Speaker,Pls. Type Name for Speaker ID. Prefix it with a "@" symbol to add a fixture such as a table.
FileAppend,`r`n%Nu%,%Gomi%
   Topper++
   Goy = %Nu%
   Boy = %Goy%
   Gui,%Topper%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%Topper%:-SysMenu
   Gui,%Topper%:Margin,0,0
   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
        Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:+LabelTable +MinSize50x40
   Gui, %Topper%:Add, Picture, w50 h50 gmoveit, %A_ScriptDir%\tbl.bmp
    Gui, %Topper%:Add,Text, x1 y1 cWhite BackgroundTrans Center,%Boy%
   Gui, %Topper%:Show,x200 y0,%Boy%
        N%Topper% = %Boy%
        Return
     }
   Gui, %Topper%:+LabelSpkr
   Gui, %Topper%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:Add,Button, x0 y0 gButtonSpeaker ,%Boy%
   Gui, %Topper%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %Topper%:Show,x200 y0,%Boy%
   M%Topper% = %Boy%
   
Return

ButtonRedraw:
Loop  ;This loop gets the current saved fontsize
{
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   IfInString,Boy,`&
      {
      StringReplace,Boy,Boy,`&,,All
      Kramer = %Boy%
      Break
      }
}
Gazebo:

Loop,%Topper%
{
If A_Index = 1
Continue
Else
Jont := % M%A_Index%
If Jont =
Continue
WinGetPos,vv,bb,,,%Jont%
   Gui, %A_Index%:Destroy
   Gui, %A_Index%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %A_Index%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %A_Index%:-SysMenu
   Gui, %A_Index%:Margin,0,0
   Gui, %A_Index%:+LabelSpkr
   Gui, %A_Index%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %A_Index%:Add,Button, x0 y0 gButtonSpeaker ,%Jont%
   Gui, %A_Index%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %A_Index%:Show, x%vv% y%bb% ,%Jont%

}Return

^#!Up::
Kramer++
Gosub,Gazebo
Return

^#!Down::
Kramer--
Gosub,Gazebo
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 3:23 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
I've made some small mods that should make it work more smoothly. First, in addition to DrugWash's excellent opening dialog I've added capability to store all the edit fields in an .ini file. So you only need fill out the form one time, and your hotkeys etc. will be stored for the next time you run it. Seemed necessary since the dialog has 10 fields.

In addition, you can toggle transparency for all the guis you create now (^+#r) . Or optionally hide/unhide all the guis. (^+#h) Pls. report bugs here.

Code:
; http://www.autohotkey.com/forum/viewtopic.php?p=274999#274999
; modified by Drugwash June 15 2009
; re-modified by ribbet.1 so there
;This script is meant to generate a set of GUIs to create a seriatim, or a log of speakers, for the purposes of transcription.  One speaker per line,and only use letters, numbers, spaces, and periods. Lines beginning with $ are where the positions of each speaker are stored and are automatically generated by moving/resizing the GUIs to resemble a diagram of the room the speakers are located, and then pressing the Save_Config button.  You may then re-use the same speaker list and the "Apply_Config" button to immediately restore the same floor plan.

;Lines beginning with a pipe symbol (|) are comment lines and are ignored by the script. It is not recommended that you save many comments in the speaker list however.

;This version is my latest little time-wasting project, a combination of this project with another I have been using as a learning tool here at AHK forums etc.  It is TRC, or Total Recorder Controller.  The basic idea here is to create a seriatim, and essentially link it to the actual recording application.  You must have total recorder installed to use it.  For testing purposes if you like you can just download an evaluation copy.  Each line on the speaker list creates a gui.  When the one button on each gui is pressed, a variable is created which holds the current time in the recording.  When the goto or gotoplay buttons are pressed, you advance backward through these bookmarks and alternately play them back in TR.  The Resume button restarts the recording after doing so.

;When the Ctrl- button is held down while pressng a GUI button, an alternate string is sent.

;Pls. try it and report bugs at
;*******************************************************************************************
SetTitleMatchMode 2 ; otherwise it doesn't detect the window
SetTitleMatchMode Fast
SetWorkingDir := A_ScriptDir

IfExist,%A_ScriptDir%\HearingINI.ini
{
IfExist,%A_ProgramFiles%\HighCriteria\TotalRecorder\TotalRecorder.exe
   Glut = %A_ProgramFiles%\HighCriteria\TotalRecorder\TotalRecorder.exe
Else Glut =
IniRead,TRpath,%A_ScriptDir%\HearingINI.ini,S1,TRpath,%Glut%
IniRead,myeditor,%A_ScriptDir%\HearingINI.ini,S2,myeditor,Notepad
IniRead,Gizmo,%A_ScriptDir%\HearingINI.ini,S3,Gizmo,%A_ScriptDir%
IniRead,Gomi,%A_ScriptDir%\HearingINI.ini,S4,Gomi,%A_ScriptDir%
IniRead,filepath,%A_ScriptDir%\HearingINI.ini,S5,filepath,%A_ScriptDir%
IniRead,Dingo,%A_ScriptDir%\HearingINI.ini,S6,Dingo,%A_WorkingDir%\%A_MM%%A_DD%%A_Hour%%A_Min%.wav
IniRead,spkpath,%A_ScriptDir%\HearingINI.ini,S7,spkpath,%A_ScriptDir%
IniRead,ehk1,%A_ScriptDir%\HearingINI.ini,S8,ehk1
IniRead,ehk2,%A_ScriptDir%\HearingINI.ini,S9,ehk2
IniRead,ehk3,%A_ScriptDir%\HearingINI.ini,S10,ehk3
}

Gui, 99:Add, GroupBox, x6 y0 w380 h350, Settings
Gui, 99:Add, Text, x16 y15 w300 h20 +0x200, Select your preferred text editor:
Gui, 99:Add, Edit, x16 y37 w300 h20 +0x200 vmyeditor, %myeditor%
Gui, 99:Add, Button, x318 y37 w60 h20 gselectedit, Browse
Gui, 99:Add, Text, x16 y59 w180 h20 +0x200, Hotkey for editor's 'Refresh' function:
Gui, 99:Add, Hotkey, x199 y59 w65 h20 vehk1, %ehk1%
Gui, 99:Add, Hotkey, x266 y59 w50 h20 vehk2, %ehk2%
Gui, 99:Add, Hotkey, x318 y59 w60 h20 vehk3, %ehk3%

Gui, 99:Add, Text, x16 y81 w300 h20 +0x200, Select seriatim file for this event (leave blank to create new):
Gui, 99:Add, Edit, x16 y103 w300 h20 vGizmo,%Gizmo%
Gui, 99:Add, Button, x318 y103 w60 h20 gselectser, Browse

Gui, 99:Add, Text, x16 y125 w300 h20 +0x200, Select storage path for seriatim file (leave blank for app folder):
Gui, 99:Add, Edit, x16 y147 w300 h20 vfilepath,%filepath%
Gui, 99:Add, Button, x318 y147 w60 h20 gselfilepath, Browse

Gui, 99:Add, Text, x16 y169 w300 h20 +0x200, Select speaker list for this event (leave blank to create new):
Gui, 99:Add, Edit, x16 y191 w300 h20 vGomi,%Gomi%
Gui, 99:Add, Button, x318 y191 w60 h20 gselectspk, Browse

Gui, 99:Add, Text, x16 y213 w300 h20 +0x200, Select storage path for speaker list (leave blank for app folder):
Gui, 99:Add, Edit, x16 y235 w300 h20 vspkpath,%spkpath%
Gui, 99:Add, Button, x318 y235 w60 h20 gselspkpath, Browse

Gui, 99:Add, Text, x16 y257 w320 h20 , Select path and filename for recording (leave blank for app folder)
Gui, 99:Add, Edit, x16 y279 w300 h20 vDingo,%Dingo%
Gui, 99:Add, Button, x318 y279 w60 h20 gselDingo, Browse

Gui, 99:Add, Text, x16 y301 w300 h20 , Select location of Total Recorder:
Gui, 99:Add, Edit, x16 y323 w300 h20 vTRpath,%TRpath%
Gui, 99:Add, Button, x318 y323 w60 h20 gselTRpath, Browse
;Gui, 99:Add, Text, x16 y330 w170 h30 , Place for name && version`,`npicture logo`, etc.
Gui, 99:Add, Button, x236 y352 w90 h30 , &Run
Gui, 99:Add, Button, x326 y352 w60 h30 , E&xit
; Generated using SmartGUI Creator 4.0
Gui, 99:Show, x271 y136 h392 w395, Settings


Return

selTRpath:
FileSelectFile,TRpath, ,%A_ProgramFiles%
IfNotExist, %TRpath%
TRpath :=
GuiControl,99:,TRpath, %TRpath%
Return

selectedit:
FileSelectFile, myeditor, 3,, Select your preferred text editor (leave blank for default):, Application (*.exe)
IfNotExist, %myeditor%
   myeditor = Notepad
GuiControl,99:, myeditor, %myeditor%
return

selectser:
FileSelectFile, Gizmo, 3,, Select seriatim file for this event (leave blank to create new):, Text file (*.txt)
IfNotExist, %Gizmo%
   Gizmo = %A_MM%-%A_DD%.txt
GuiControl,99:, Gizmo, %Gizmo%
return

selectspk:
FileSelectFile, Gomi, 3,, Select speaker list for this event (leave blank to create new):, Text file (*.txt)
IfNotExist, %Gomi%
   {
   neededit=1
   Gomi = 00Speakerlist%A_MM%%A_DD%%A_Hour%%A_Min%.txt
   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates a generic speaker list
   }
GuiControl,99:, Gomi, %Gomi%
return

selfilepath:
FileSelectFolder, filepath, *%A_WorkingDir%, 3, Select storage path for seriatim file (leave blank for app folder):
IfNotExist, %filepath%
   filepath := A_WorkingDir
filepath := RegExReplace(filepath, "\\$")
GuiControl,99:, filepath, %filepath%
return

selDingo:
FileSelectFile, Dingo, 8, %A_MM%%A_DD%%A_Hour%%A_Min%.wav, Select storage path and filename for recording (leave blank for app folder\mmddhhmm.wav):
IfNotExist, %Dingo%
Dingo = %A_WorkingDir%\%A_MM%%A_DD%%A_Hour%%A_Min%.wav
GuiControl,99:, Dingo, %Dingo%
Return


selspkpath:
FileSelectFolder, spkpath, *%A_WorkingDir%, 3, Select storage path for speaker list (leave blank for app folder):
IfNotExist, %spkpath%
   spkpath := A_WorkingDir
spkpath := RegExReplace(spkpath, "\\$")
GuiControl,99:, spkpath, %spkpath%
return

99ButtonExit:
99GuiClose:
ExitApp

99ButtonRun:
Gui, 99:-OwnDialogs
Gui, 99:Submit ; needs double-check for filename/path errors

IniWrite,%TRpath%,%A_ScriptDir%\HearingINI.ini,S1,TRpath
IniWrite,%myeditor%,%A_ScriptDir%\HearingINI.ini,S2,myeditor
IniWrite,%Gizmo%,%A_ScriptDir%\HearingINI.ini,S3,Gizmo
IniWrite,%Gomi%,%A_ScriptDir%\HearingINI.ini,S4,Gomi
IniWrite,%filepath%,%A_ScriptDir%\HearingINI.ini,S5,filepath
INiWrite,%Dingo%,%A_ScriptDir%\HearingINI.ini,S6,Dingo
INiWrite,%spkpath%,%A_ScriptDir%\HearingINI.ini,S7,spkpath
IniWrite,%ehk1%,%A_ScriptDir%\HearingINI.ini,S8,ehk1
IniWrite,%ehk2%,%A_ScriptDir%\HearingINI.ini,S9,ehk2
IniWrite,%ehk3%,%A_ScriptDir%\HearingINI.ini,S10,ehk3

IfNotExist, %Gizmo%
   Gizmo = %A_MM%-%A_DD%.txt
IfNotExist, %Gomi%
   {
   neededit=1
   Gomi = 00Speakerlist%A_MM%%A_DD%%A_Hour%%A_Min%.txt
   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates a generic speaker list
   }
IfNotExist, %myeditor%
   myeditor = Notepad

refresh := (ehk1 ? "{" ehk1 "}" : "") . (ehk2 ? "{" ehk2 "}" : "") . (ehk3 ? "{" ehk3 "}" : "")
Loop, %Gizmo%
   FileMove, %Gizmo%, filepath "\" A_LoopFileName
Loop, %Gomi%
   FileMove, %Gomi%, spkpath "\"  A_LoopFileName
Rosie =
nn =
grip=15 ; width of blue grip to the right of the speaker labels
if neededit
   {
   Msgbox,%Gomi% is your speaker list.  Start by changing the examples to your actual speakers.  You may add as many as you wish.  Make them one name per line only. Numbers and Letters only`, no commas`,colons`, semicolons or any other funny business.  Periods are allowed. You may always revise the list and restart the program again too. Pls. note that one called `"table`" has no button and can be shaped and resized to resemble oh, say, a table.  You may create buttonless GUIs for this purpose by prefixing their name with the `"`@`" symbol.
   RunWait, %myeditor% %Gomi%
   Sleep, 1000   ; allow the OS to save the file properly
   }
MsgBox,You will need to turn on `"append mode under `"Record`/Play`" on the toolbar menu`, and you will also need to select `"show sound image`" either `"in panel`" or `"in separate window.`"  It is presumed that you have a working knowledge of Total Recorder prior to using this.  If so`, now would be a good time to start the recording.  If not`, you should exit this program and go learn your way around TR before trying this.

Run %TRpath% "%A_WorkingDir%\%A_MM%%A_DD%%A_Hour%%A_Min%.wav" /Record /T:1 /Noclose

;*******************************************************************************************
SplitPath,Gomi,Omig,Moig


IfWinExist,ahk_class TotalRecorderWndClass
WinActivate,ahk_class TotalRecorderWndClass



Topper = 1
Gui, 1:Margin, 0, 0
Gui, 1:Add, Button, x0 y0 w80 h24 , Record
Gui, 1:Add, Button, x80 y00 w80 h24 , Resume
Gui, 1:Add, Button, x0 y24 w80 h24 , Q
Gui, 1:Add, Button, x80 y24 w80 h24 , A
Gui, 1:Add, Button, x0 y48 w80 h24 , Save_Config
Gui, 1:Add, Button, x80 y48 w80 h24 , Apply_Config
Gui, 1:Add, Button, x0 y72 w80 h24 , Goto
Gui, 1:Add, Button, x80 y72 w80 h24 , Goto_play
Gui, 1:Add, Button, x0 y96 w80 h24 , View_log
Gui, 1:Add, Button, x80 y96 w80 h24 , Speakerlist
Gui, 1:Add, Button, x0 y120 w80 h24 , Bookmark
Gui, 1:Add, Button, x80 y120 w80 h24 , Query
Gui, 1:Add, Button, x0 y144 w40 h24 , <<
Gui, 1:Add, Button, x40 y144 w40 h24 , <
Gui, 1:Add, Button, x80 y144 w40 h24 , >
Gui, 1:Add, Button, x120 y144 w40 h24 , >>
Gui, 1:Add, Button, x0 y168 w80 h24 , Reload
Gui, 1:Add, Button, x80 y168 w80 h24 ,Toggle_TR
Gui, 1:Add, Button, x0 y192 w80 h24 ,Add_Speaker
Gui, 1:Add, Button, x80 y192 w80 h24 ,Redraw
Gui, 1:+AlwaysOnTop
; Generated using SmartGUI Creator 4.0 by Rajat
Gui, 1:Show,x0 y0, TRC
Gui, 1:+Default

M%Topper% = TRC

Loop
{
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   IfInString,Boy,|
   Continue
   IfInString,Boy,$
   Break
   If Boy =
   Continue
   IfInString,Boy,`&
      {
      StringReplace,Boy,Boy,`&,,All
      Kramer = %Boy%
    eBoy = 1
      Continue
      }
   Topper++
   Goy = %Boy%
   Boy = %Goy%
   Gui,%Topper%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%Topper%:-SysMenu
   Gui,%Topper%:Margin,0,0

   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
     Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:+LabelTable +MinSize50x40
   Gui, %Topper%:Add, Picture, w50 h50 gmoveit, %A_ScriptDir%\tbl.bmp
    Gui, %Topper%:Add,Text, x1 y1 cWhite BackgroundTrans Center,%Boy%
   Gui, %Topper%:Show,x200 y0,%Boy%
        N%Topper% = %Boy%
        Continue
     }
   Gui, %Topper%: -Caption
   Gui, %Topper%:+LabelSpkr
   Gui, %Topper%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:Add,Button, x0 y0 gButtonSpeaker ,%Boy%
   Gui, %Topper%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %Topper%:Show,x200 y0,%Boy%
   M%Topper% = %Boy%
}

FileAppend,`r`n`[Script started %A_MM%-%A_DD%-%A_Hour%:%A_Min%:%A_Sec%`]`r`n,%Gizmo%

Run %myeditor% %Gizmo%

Return

TableSize:
GuiControl, %A_Gui%:MoveDraw, Static1, x0, y0, w%A_GuiWidth%, h%A_GuiHeight%
GuiControl, %A_Gui%:MoveDraw, Static2, x0, y0, w%A_GuiWidth%
return

SpkrSize:
nx := A_GuiWidth-grip
GuiControl, %A_Gui%:MoveDraw, Static1, x%nx%, y0, w%grip%, h%A_GuiHeight%
GuiControl, %A_Gui%:MoveDraw, Button1, x0, y0, w%nx% , h%A_GuiHeight%
return

moveit:
PostMessage, 0xA1, 2,,, A ; this allows dragging a window by any spot ;-)
return

ButtonSpeaker:
GetKeyState,ByB,Alt

If ByB = D
{
Jont := % M%A_Gui%
WinGetPos,vv,bb,,,%Jont%
Gui, %A_Gui%:Destroy
   Gui,%A_Gui%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %A_Gui%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%A_Gui%:-SysMenu
   Gui,%A_Gui%:Margin,0,0
   Gui, %A_Gui%:+LabelSpkr
   Gui, %A_Gui%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %A_Gui%:Add,Button, x0 y0 gButtonSpeaker ,%Jont%
   Gui, %A_Gui%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %A_Gui%:Show, x%vv% y%bb% ,%Jont%
Return
}
If A_Gui = 1
{
Gosub Button%Speaker%
Sleep,50
Goto Scrapple
}
Else

GetKeyState,ByA,Ctrl
If ByA = D
{
 ControlGetText,Timex,Static8,%Dingo%
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[ %Timex% - %timey% `]%A_Tab%%A_Tab%BY%A_Space%,%Gizmo%
 FileAppend,% M%A_Gui% ":",%Gizmo%
}
Else
{
 ControlGetText,Timex,Static8,%Dingo%
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[ %Timex% - %timey% `],%Gizmo%
 FileAppend,% M%A_Gui%,%Gizmo%
 FileAppend,:*.%A_Space%, %Gizmo%
}
 Rosie++
 R%Rosie% := Timex
 Pinky = %Rosie%
 Goto Scrapple
 
^+#Escape::ExitApp

;-----------------------------------------------------

ButtonSave_Config:

FileDelete,Deleme.txt

Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   StringReplace,FancyPants,A_LoopReadLine,`n,,All
   StringReplace,FancyPants,FancyPants,`r,,All
   StringReplace,FancyPants,FancyPants,`,,``,,All
   IfInString,FancyPants,$
   Continue
   IfInString,FancyPants,`&
   {
   FancyPants = `&%Kramer%
   Moto = 1
   }
   FileAppend,%FancyPants%`r`n

}
Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   IfInString,A_LoopReadLine,|
   Continue
   IfInString,A_LoopReadLine,$
   Continue
   IfInString,A_LoopReadLine,`&
   Continue
   Autotrim,On
   FancyPants = %A_LoopReadLine%
   StringReplace,FancyPants,FancyPants,@,,All
   WinGetPos,xx,yy,ww,hh,%FancyPants%
   FileAppend,$%FancyPants%`,%xx%`,%yy%`,%ww%`,%hh%`r`n
}
WinGetPos,xx,yy,ww,hh,TRC
FileAppend,$TRC`,%xx%`,%yy%`,`,`r`n,deleme.txt

WinGetPos,xx,yy,,,%Dingo%
FileAppend,$%Dingo%`,%xx%`,%yy%`,`,`r`n,deleme.txt

If Moto =
If Kramer =
FileAppend,`&12,deleme.txt
Else
FileAppend,`&%Kramer%,deleme.txt
FileAppend,`r`n,deleme.txt

FileMove,deleme.txt,%Gomi%,1


Return

ButtonApply_Config: ;;This reads all lines containing "$" and moves the GUIs to those positions.
Loop
{
   FileReadLine,Troy,%Gomi%,%A_Index%
      If Troy =
   Break

   IfInString,Troy,$
      {
      StringSplit,aa,Troy,`,,$
      WinMove,%aa1%,,%aa2%,%aa3%,%aa4%,%aa5%
         IfInString,Troy,TRC
         Gui 1:Show, x%aa2% y%aa3%, TRC
      }
}
Return
;-----------------------------------------------------

;TRC stuff follows

;-----------------------------------------------------
Pause::Suspend
;-----------------------------------------------------

ButtonQuery:
ControlGetText,Timex,Static8,%Dingo%
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey%-00QUERY`]
goto commonsub

ButtonQ:
ControlGetText,Timex,Static8,%Dingo%
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey% `]Q*.%A_Space%
goto commonsub

ButtonA:
ControlGetText,Timex,Static8,%Dingo%
FormatTime, timey,, HH:mm:ss
stringtolog = `n[ %Timex% - %timey% `]A*.%A_Space%
goto commonsub

ButtonBookmark:
ControlGetText,Timex,Static8,%Dingo%
FormatTime, timey,, HH:mm:ss
; shouldn't this have a newline prepended ??? I added one, just in case
stringtolog = `n*.%A_Space%[ %Timex% -%timey%--00Marker`]
commonsub:
Rosie++
FileAppend, %stringtolog%,%Gizmo%
R%Rosie% := Timex
Pinky = %Rosie%
Goto Scrapple

ButtonRecord:
;nn = 1
;Rosie++
Disney = 1
ControlGetText,Timex,Static8,%Dingo%
ControlClick,Button14,%Dingo%
R%Rosie% = %Timex%
;FormatTime, timey,, HH:mm:ss
FileAppend, `r`n`[Recording Begin %Timex% -%timey%`],%Gizmo%
ControlClick,Button20,%Dingo%
;Pinky = %Rosie%
WinSet,AlwaysOnTop,Off,%Dingo%
Return

ButtonGoto_Play:
WinSet,AlwaysOnTop,On,%Dingo%
If Disney <>
{
WinActivate,Total Recorder
Rosie++
ControlGetText,Timex,Static8,%Dingo%
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex% -%timey%`],%Gizmo%
}
Gosub, Backup
Sleep,50
ControlClick,Button16,%Dingo%
Disney =
Return

ButtonGoto:
WinSet,AlwaysOnTop,On,%Dingo%
If Disney <>
{
WinActivate,Total Recorder
Rosie++
ControlGetText,Timex,Static8,%Dingo%
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex% -%timey%`],%Gizmo%
Pinky = %Rosie%
}
Gosub, Backup
Disney =
Return

Backup:
Pinky--
if Pinky < 0
   return   ; otherwise it throws an error
Rnn := R%Pinky%
ControlClick,Button19,%Dingo%
Sleep,50
ControlClick,ToolBarWindow324,%Dingo%
WinWaitActive,Jump to time
Sleep,50
ControlSetText,Edit1,%Rnn%,Jump to time
Sleep,50
ControlClick,Button3,Jump to time
Sleep,30
If Pinky = 1
{
Msgbox,,2,Out of bookmarks!,.5
Pinky = %Rosie%
}
Return

JumpBox:
^+j::
ControlClick,ToolBarWindow324,%Dingo%
Return

ButtonView_log:
SetTitleMatchMode,1
IfWinNotExist,%Gizmo%
{
Run %myeditor% %Gizmo%
WinWaitActive,%Gizmo%
ControlSend,,^{End},%Gizmo%
Return
}
Else
Winkill,%Gizmo%
Return

ButtonSpeakerlist:
IfWinNotExist,%Omig%
{
Run %myeditor% %Gomi%
WinWaitActive,%Omig%
ControlSend,,^{End},%Omig%
Return
}
Else
WinKill,%Omig%
Return


ButtonResume:
nn = 1
Disney = 1
ControlClick,Button14,%Dingo%
Sleep,10
ControlGetText,Timex,Static8,%Dingo%
R%Rosie% := Timex
FileAppend, `r`n[Recording Resume %Timex% -%timey%`],%Gizmo%
ControlClick,Button20,%Dingo%
WinSet,AlwaysOnTop,Off,%Dingo%
Gosub,Scrapple
Return

^#c:: ;;This sends highlighted text to the TR jumpbox and presses OK
Send,^c
Bubba := Clipboard
ControlClick,Button19,%Dingo%
Sleep,300
ControlClick,ToolBarWindow324,%Dingo%
WinWait,Jump to time
WinActivate,Jump to time
ControlSend,Edit1,%Bubba%,Jump to time
Sleep,60
ControlClick,Button3,Jump to time,Jump
Return

Button<<:
ControlClick,Button11,%Dingo%
Return

Button<:
ControlClick,Button12,%Dingo%
Return

Button>:
ControlClick,Button13,%Dingo%
Return

Button>>:
ControlClick,Button14,%Dingo%
Return


ButtonReload:
^+#Backspace:
Reload
Return

ButtonToggle_TR:
^+#t::  ;;toggle TR to front and back
Abby++
If Abby = 1
   {
   WinSet,AlwaysOnTop,ON,%Dingo%
   WinActivate,%Dingo%
   Return
   }
Else
   {
   WinSet,AlwaysOnTop,Off,%Dingo%
   WinActivate,%Dingo%
   Gosub,Scrapple
   If Abby > 1
   Abby = 0
   }
Return

Scrapple:
IfWinNotExist,%Gizmo%
{
Run %myeditor% %Gizmo%
WinWaitActive,%Gizmo%
ControlSend,,^{End},%Gizmo%
Return
}
Else if refresh
   {
   WinActivate, %Gizmo%
   WinWaitActive, %Gizmo%
   SendInput %refresh%
   }
Else
{
WinKill,%Gizmo%
Run %myeditor% %Gizmo%
}
WinWaitActive,%Gizmo%
ControlSend,,^{End}, %Gizmo%
Return

ButtonAdd_Speaker:

Gui, 98: Add, Text,, Pls. Type Name for Speaker ID. Prefix it with a "@" symbol to `r`nadd a fixture such as a table.
Gui, 98: Add, Edit, w300 h20 vNu,Add speaker here
Gui, 98: Add, Button,w60 h20 gNuSel,Add
Gui, 98: Show, w350 h100, Add New Speaker
Gui, 98: +AlwaysOnTop
Return

NuSel:
;MsgBox,%Nu%
ControlGetText,Nu,Edit1,Add New Speaker
If Nu = Add speaker here
;Nu =
If Nu =
Nu = Voice
GuiControl,98: , Nu, %Nu%
FileAppend,`r`n%Nu%,%Gomi%
   Topper++
   Goy = %Nu%
   Boy = %Goy%
   Gui,%Topper%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui,%Topper%:-SysMenu
   Gui,%Topper%:Margin,0,0
   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
        Gui, %Topper%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:+LabelTable +MinSize50x40
   Gui, %Topper%:Add, Picture, w50 h50 gmoveit, %A_ScriptDir%\tbl.bmp
    Gui, %Topper%:Add,Text, x1 y1 cWhite BackgroundTrans Center,%Boy%
   Gui, %Topper%:Show,x200 y0,%Boy%
        N%Topper% = %Boy%
        Return
     }
   Gui, %Topper%:+LabelSpkr
   Gui, %Topper%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %Topper%:Add,Button, x0 y0 gButtonSpeaker ,%Boy%
   Gui, %Topper%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %Topper%:Show,x200 y0,%Boy%
   M%Topper% = %Boy%
Return

98ButtonAdd:
   ;Gui, 98:-OwnDialogs
   Gui, 98: Submit
   ;MsgBox,Done
   ;Sleep,100
   ;WinWait,%Nu%
   ;WinActivate,Add New Speaker
   Gui Destroy
Return

98GuiEscape:
98GuiClose:
98ButtonCancel:
Gui Destroy
Return


ButtonRedraw:
Loop  ;This loop gets the current saved fontsize
{
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   IfInString,Boy,`&
      {
      StringReplace,Boy,Boy,`&,,All
      Kramer = %Boy%
      Break
      }
}
Gazebo:

Loop,%Topper%
{
If A_Index = 1
Continue
Else
Jont := % M%A_Index%
If Jont =
Continue
WinGetPos,vv,bb,,,%Jont%
   Gui, %A_Index%:Destroy
   Gui, %A_Index%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop +MinSize50x16 -Caption
   Gui, %A_Index%:Font, S%Kramer% ;,MS Sans Serif
   Gui, %A_Index%:-SysMenu
   Gui, %A_Index%:Margin,0,0
   Gui, %A_Index%:+LabelSpkr
   Gui, %A_Index%:Font,S%Kramer% ;,MS Sans Serif
   Gui, %A_Index%:Add,Button, x0 y0 gButtonSpeaker ,%Jont%
   Gui, %A_Index%:Add, Picture, x+1 yp w%grip% hp gmoveit, %A_ScriptDir%\spk.bmp
   Gui, %A_Index%:Show, x%vv% y%bb% ,%Jont%

}Return

^#!Up::
Kramer++
Gosub,Gazebo
Return

^#!Down::
Kramer--
Gosub,Gazebo
Return



^+#h::

Buck++
If Buck > 1
Buck =

Loop,%Topper%
   {
      If A_Index = 1
      Continue

      Jont := % M%A_Index%
      If Jont =
      Continue

      If Buck = 1
      WinHide %Jont%

      If Buck =
      WinShow %Jont%
   }
Return

^+#r::

Buck++
If Buck > 1
Buck =

Loop,%Topper%
   {
      If A_Index = 1
      Continue

      Jont := % M%A_Index%
      If Jont =
      Continue

      If Buck = 1
      WinSet, Transparent, 100, %Jont%

      If Buck =
      WinSet, TransColor, Off, %Jont%
   }
Return



Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 3rd, 2009, 4:01 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
I am trudging onward with this, and really liking my results. I've integrated many of the suggestions of Drugwash and Hubert and others, and I feel so far that this is by far the most simple and user friendly version. Here is a pic of it

Image

And here is the dl link, including one example seating list, which is the one shown in above screen capture.

http://homeofthegnome.net/AHK/HearingAid9.3.4.zip

Note: Does not absolutely require that you use Total Recorder, a commercial 3rd party program, but I really intended it for use with it and you don't really benefit as much from this script without it.

Drugwash, I've really enjoyed learning from your suggested code and, as you can see, I've incorporated part of it. There are other versions that do more, but this is the aforementioned "joe user" version, which IMO is right for adhering to the KISS principle.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 11th, 2009, 12:23 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Glad I could be of help. I'm currently far from a computer environment thus unable to finish the task I took on - that is creating a fully fledged media player/recorder for use with this (or similar) script or as standalone application.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Trudging forward
PostPosted: September 25th, 2009, 4:17 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Hi, project continues, I'm calling it version 9.3.9. I've added a visible timer that displays current recording duration in large green letters, and added a feature to make the GUIs flash whenever recording is paused, stop flashing when recording resumes. A few other little bells and whistles, like you can now drag and drop your speaker list onto the icon to start the program.

http://www.enctranscripts.com/hearingaid.htm

Todo:

Optimize/clean up code. -- I wish somebody more skillful would take a look at this and offer some advice in this regard. My scripting is pretty rudimentary even now.

Incorporate freeware recorder instead of commercial app.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2010, 9:50 am 
thank :D


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], JSLover, Miguel, rbrtryn and 65 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group