TweakMonkey (advanced options page) 1.02 - 4/2/2007 [MM2+3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

rovingcowboy
Posts: 14153
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Mon May 29, 2006 11:01 pm

he's removed it i guess he is updating it or put it in another thread for some unknown reason?

8)
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Tue May 30, 2006 6:31 am

Teknojnky, I'm curious about the script.
I have some improvements I want to contribute to it, but of course that'll only be possible when I see the next version, just to do no double work or so.

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).

Teknojnky
Posts: 5523
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Tue May 30, 2006 10:25 am

re-posting, minor fix for default node visibility (had reversed logic).

as now noted within the script, I explicitly give permission for anyone to modify and contribute to this script.

I had always hoped it would be a community project more than something I did for myself.

I do not think that I used anyone's specific code, however I did try to learn from many different scripts while making this one. If there is code here which you feel belongs to you and it's not properly credited, PM me with the details (if you wish it removed or credited).

Code: Select all

' auto-script to add tweakmonkey options sheets' 
' save as "TweakMonkeyConfig.vbs" in your "MM\Scripts\Auto" folder' 
' by Teknojnky intiated 3/21/2006' 
' written with pspad @ http://www.pspad.com' 
' note: if you want more control over specific startup and favorite nodes 
' please check out Steegy's Scripts 
' FavoriteNodes @ http://www.mediamonkey.com/forum/viewtopic.php?t=7490 
' StartupNode @ http://www.mediamonkey.com/forum/viewtopic.php?t=7656 
' as my startup nodes currently only work for the base nodes' 
' known issues: hiding web and radio nodes appears to not work, use the' 
' standard MM options-appearence-tree settings' 

'***** You are free to do anything with this code including modifying and posting
'***** in whole or part, but please detail any changes you make public
'***** and make sure you credit yourself (and previous authors)
'***** I accept no responsibility for any damages or lost data during use


option explicit 
  Public Const Version = ".61"       'Version' 
  Public Const Updated = "5/30/2006" 'Last updated' 

dim NodeArray(15)           'Store node name for ini and dropdown list' 
' All available standard node references per Steegy: 
  NodeArray(0) = "NowPlaying" ' Node_NowPlaying 
  NodeArray(1) = "Library"    ' Node_Library 
  NodeArray(2) = "Location"   ' Node_Location 
  NodeArray(3) = "Artist"     ' Node_Artist 
  NodeArray(4) = "Album"      ' Node_Album 
  NodeArray(5) = "Genre"      ' Node_Genre 
  NodeArray(6) = "Year"       ' Node_Year 
  NodeArray(7) = "Rating"     ' Node_Rating 
  NodeArray(8) = "Classification"      ' Node_Classification 
  NodeArray(9) = "FilesToEdit"' Node_FilesToEdit 
  NodeArray(10)= "VirtualCD"  ' Node_VirtualCD 
  NodeArray(11)= "Previews"   ' Node_Previews 
  NodeArray(12)= "Playlists"  ' Node_Playlists 
  NodeArray(13)= "MyComputer" ' Node_MyComputer 
  NodeArray(14)= "Radio"      ' Node_Radio 
  NodeArray(15)= "Web"        ' Node_Web 


Sub OnStartup 
  dim TweakSheetRoot, TweakSheetTree, TweakSheetAutoExec, ini 
  Dim TweakSheetAutoRate 
  
' events to use in the future 
'   Script.RegisterEvent SDB, "OnPlay", "OnPlayEvents" 
'   Script.RegisterEvent SDB, "OnStop", "OnStopEvents" 
'   Script.RegisterEvent SDB, "OnShutDown", "OnShutDownEvents" 
'      
  TweakSheetRoot = SDB.UI.AddOptionSheet("TweakMonkey & Script Options", Script.ScriptPath, _ 
    "InitSheetRoot", "SaveSheetRoot", -1) 
  TweakSheetAutoExec = SDB.UI.AddOptionSheet("AutoExec Options", _ 
    Script.ScriptPath, "InitSheetAutoExec", "SaveSheetAutoExec", TweakSheetRoot) 
  TweakSheetTree = SDB.UI.AddOptionSheet("Tree Node Options", _ 
    Script.ScriptPath, "InitSheetTree", "SaveSheetTree", TweakSheetRoot) 

  Set ini = SDB.IniFile 

' wait for sdb to load - thanks DiddeleeDoo' 
  While Not SDB.IsRunning 
  WEnd 

' auto-set player volume at startup (no more super loud music when play starts) 
  Dim Volume 
  Volume = ini.StringValue("TweakMonkey","Volume") 
  If Volume <> "" Then 
    SDB.Player.Volume = (Volume/100)            ' set volume @ Steegy 
  End If 

' show/hide/expand/collapse any specific nodes --------------------------------- 
' Now Playing does not expand so its not tested' 
    
    If ini.StringValue("Tree","NowPlaying") = "0" Then 
      SDB.MainTree.Node_NowPlaying.Visible = False 
    End If 
    
    If ini.StringValue("Tree", "Library") <> "0" Then 
      If ini.StringValue("TweakMonkey", "LibraryExpanded") = "False" Then 
        SDB.MainTree.Node_Library.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "LibraryExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Library.Visible = False 
    End If 

    If ini.StringValue("Tree", "Location") <> "0" Then 
      If ini.StringValue("TweakMonkey", "LocationExpanded") = "False" Then 
        SDB.MainTree.Node_Location.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "LocationExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Location.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Location.Visible = False 
    End If 

    If ini.StringValue("Tree", "Title") <> "0" Then 
      If ini.StringValue("TweakMonkey", "TitleExpanded") = "False" Then 
        SDB.MainTree.Node_Title.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "TitleExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Title.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Title.Visible = False 
    End If 

    If ini.StringValue("Tree", "Artist") <> "0" Then 
      If ini.StringValue("TweakMonkey", "ArtistExpanded") = "False" Then 
        SDB.MainTree.Node_Artist.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "ArtistExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Artist.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Artist.Visible = False 
    End If 

    If ini.StringValue("Tree", "Album") <> "0" Then 
      If ini.StringValue("TweakMonkey", "AlbumExpanded") = "False" Then 
        SDB.MainTree.Node_Album.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "AlbumExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Album.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Album.Visible = False 
    End If 
      
    If ini.StringValue("Tree", "Genre") <> "0" Then 
      If ini.StringValue("TweakMonkey", "GenreExpanded") = "False" Then 
        SDB.MainTree.Node_Genre.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "GenreExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Genre.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Genre.Visible = False 
    End If 

    If ini.StringValue("Tree", "Year") <> "0" Then 
      If ini.StringValue("TweakMonkey", "YearExpanded") = "False" Then 
        SDB.MainTree.Node_Year.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "YearExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Year.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Year.Visible = False 
    End If 
  
    If ini.StringValue("Tree", "Rating") <> "0" Then 
      If ini.StringValue("TweakMonkey", "RatingExpanded") = "False" Then 
        SDB.MainTree.Node_Rating.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "RatingExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Rating.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Rating.Visible = False 
    End If 
  
    If ini.StringValue("Tree", "Classification") <> "0" Then 
      If ini.StringValue("TweakMonkey", "ClassificationExpanded") = "False" Then 
        SDB.MainTree.Node_Classification.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "ClassificationExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Classification.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Classification.Visible = False 
    End If 

    If ini.StringValue("Tree", "FilesToEdit") <> "0" Then  
      If ini.StringValue("TweakMonkey", "FilesToEditExpanded") = "False" Then 
        SDB.MainTree.Node_FilesToEdit.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "FilesEditExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_FilesToEdit.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_FilesToEdit.Visible = False 
    End If 
  
    If ini.StringValue("Tree", "VirtualCD") <> "0" Then 
      If ini.StringValue("TweakMonkey", "VirtualCDExpanded") = "False" Then 
        SDB.MainTree.Node_VirtualCD.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "VirtualExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Virtual.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_VirtualCD.Visible = False 
    End If 
  
    If ini.StringValue("Tree", "Previews") <> "0" Then 
      If ini.StringValue("TweakMonkey", "PreviewsExpanded") = "False" Then 
        SDB.MainTree.Node_Previews.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "PreviewsExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Previews.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Previews.Visible = False 
    End If 
  
    If ini.StringValue("Tree", "Playlists") <> "0" Then  
      If ini.StringValue("TweakMonkey", "PlaylistsExpanded") = "False" Then 
        SDB.MainTree.Node_Playlists.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "PlaylistsExpanded") = "True" Then 
        SDB.MainTree.Node_Playlists.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Playlists.Visible = False 
    End If 

    If ini.StringValue("Tree", "MyComputer") <> "0" Then  
      If ini.StringValue("TweakMonkey", "MyComputerExpanded") = "False" Then 
        SDB.MainTree.Node_MyComputer.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "MyComputerExpanded") = "True" Then 
        SDB.MainTree.Node_MyComputer.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_MyComputer.Visible = False 
    End If 

    If ini.StringValue("Tree", "RadioExpanded") <> "0" Then  
      If ini.StringValue("TweakMonkey", "RadioExpanded") = "False" Then 
        SDB.MainTree.Node_Radio.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "RadioExpanded") = "True" Then 
        SDB.MainTree.Node_Radio.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Radio.Visible = False 
    End If 

    If ini.StringValue("Tree", "Web") <> "0" Then  
      If ini.StringValue("TweakMonkey", "WebExpanded") = "False" Then 
        SDB.MainTree.Node_Web.Expanded = False 
      End If 
      If ini.StringValue("TweakMonkey", "WebExpanded") = "True" Then 
        SDB.MainTree.Node_Library.Expanded = True 
        SDB.MainTree.Node_Web.Expanded = True 
      End If 
    Else 
      SDB.MainTree.Node_Web.Visible = False 
    End If 


' startup node ----------------------------------------------------------------- 
  Dim StartupNode 
  StartupNode = ini.StringValue("TweakMonkey","StartupNode") 
  If StartupNode <> "" Then 
    Select Case StartupNode 
      Case "NowPlaying"     SDB.MainTree.CurrentNode = SDB.MainTree.Node_NowPlaying 
      Case "Library"        SDB.MainTree.CurrentNode = SDB.MainTree.Node_Library 
      Case "Location"       SDB.MainTree.CurrentNode = SDB.MainTree.Node_Location 
      Case "Artist"         SDB.MainTree.CurrentNode = SDB.MainTree.Node_Artist 
      Case "Album"          SDB.MainTree.CurrentNode = SDB.MainTree.Node_Album 
      Case "Genre"          SDB.MainTree.CurrentNode = SDB.MainTree.Node_Genre 
      Case "Year"           SDB.MainTree.CurrentNode = SDB.MainTree.Node_Year 
      Case "Rating"         SDB.MainTree.CurrentNode = SDB.MainTree.Node_Rating 
      Case "Classification" SDB.MainTree.CurrentNode = SDB.MainTree.Node_Classification 
      Case "Edit"           SDB.MainTree.CurrentNode = SDB.MainTree.Node_FilesToEdit 
      Case "VirtualCD"      SDB.MainTree.CurrentNode = SDB.MainTree.Node_VirtualCD 
      Case "Previews"       SDB.MainTree.CurrentNode = SDB.MainTree.Node_Previews 
      Case "Playlists"      SDB.MainTree.CurrentNode = SDB.MainTree.Node_Playlists 
      Case "MyComputer"     SDB.MainTree.CurrentNode = SDB.MainTree.Node_MyComputer 
      Case "Radio"          SDB.MainTree.CurrentNode = SDB.MainTree.Node_Radio 
      Case "Web"            SDB.MainTree.CurrentNode = SDB.MainTree.Node_Web      
      Case Else   MsgBox "Invalid Node saved" 
    End Select 
  End If 

' ClearPlaylist/Auto-Play/Resume/Shuffle/Repeat/Randomize/LoadPlaylist --------- 
  Dim ClearNowPlaying, Playlist, LoadPlaylist, AutoPlay, AutoResume 
  Dim AutoRandomize, AutoShuffle, AutoRepeat, ExploreFolder, CommandFolder 
  Dim PlaylistTracks, Playit 
  
  ClearNowPlaying = ini.StringValue("TweakMonkey", "ClearNowPlaying") 
  Playlist = ini.StringValue("TweakMonkey","Playlist") 
  LoadPlaylist = ini.StringValue("TweakMonkey","LoadPlaylist") 
  AutoPlay = ini.StringValue("TweakMonkey","AutoPlay") 
  AutoResume = ini.StringValue("TweakMonkey","AutoResume") 
  AutoRandomize = ini.StringValue("TweakMonkey","AutoRandomize") 
  AutoShuffle = ini.StringValue("TweakMonkey","AutoShuffle") 
  AutoRepeat = ini.StringValue("TweakMonkey","AutoRepeat") 
  ExploreFolder = ini.StringValue("TweakMonkey","ExploreFolder") 
  CommandFolder = ini.StringValue("TweakMonkey","CommandFolder") 
      
  If ClearNowPlaying = "True" Then 
    SDB.Player.PlaylistClear 
  Else 
    If LoadPlayList = "True" Then 
      If Playlist <> "" Then 'TODO need to check if playlist is valid somehow' 
          SDB.Player.PlaylistClear ' "_Unplayed Recently Added" "NowPlaying" ' 
          Set PlaylistTracks = SDB.PlaylistByTitle(Playlist).Tracks 
          SDB.Player.PlaylistAddTracks(PlaylistTracks) 
      End If      
    End If 

    If AutoRandomize = "True" Then 
      'TODO need to find the randomize playlist command' 
    End If    

    If AutoShuffle = "True" Then 
      SDB.Player.isShuffle = True 
    End If 
    
    If AutoRepeat = "True" Then 
      SDB.Player.isRepeat = True 
    End If 
    
    If AutoPlay = "True" Then 
      If AutoResume = "True" Then 
'         SDB.Player.Play 'TODO add auto-resume code here' 
      End If 
      SDB.Player.Play 'auto play without resume' 
    End If 
  End If 

' add context menus' 
  If ExploreFolder = "True" Then 
    Dim AddExploreFolder 
    set AddExploreFolder = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_Tree,1,3) 
    With AddExploreFolder 
      .Caption = "Explorer this Folder" 
      .OnClickFunc = "ExploreFolder" 
      .UseScript = Script.ScriptPath 
      .IconIndex = 70 
    End With 
  
    set AddExploreFolder = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList,1,1) 
    With AddExploreFolder 
      .Caption = "Explorer this Folder" 
      .OnClickFunc = "ExploreFolder" 
      .UseScript = Script.ScriptPath 
      .IconIndex = 70 
    End With 

    set AddExploreFolder = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP,1,1) 
    With AddExploreFolder 
      .Caption = "Explorer this Folder" 
      .OnClickFunc = "ExploreFolder" 
      .UseScript = Script.ScriptPath 
      .IconIndex = 70 
    End With 
  End If 
  
  If CommandFolder = "True" Then 
    Dim AddCommandFolder 
    set AddCommandFolder = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_Tree,1,3) 
    With AddCommandFolder 
      .Caption = "Command Prompt this Folder" 
      .OnClickFunc = "CommandFolder" 
      .UseScript = Script.ScriptPath 
      .IconIndex = 70 
    End With 
  
    set AddCommandFolder = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList,1,1) 
    With AddCommandFolder 
      .Caption = "Command Prompt this Folder" 
      .OnClickFunc = "CommandFolder" 
      .UseScript = Script.ScriptPath 
      .IconIndex = 70 
    End With 

    set AddCommandFolder = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP,1,1) 
    With AddCommandFolder 
      .Caption = "Command Prompt this Folder" 
      .OnClickFunc = "CommandFolder" 
      .UseScript = Script.ScriptPath 
      .IconIndex = 70 
    End With 
  End If 

' TODO forthcoming options'----------------------------------------------------- 
' auto-load/play specific playlists 
' auto-resume (start track from time it stopped) 
' auto-save current now playing list to a database playlist on shutdown 
' a method to change the location of your library database and optionally 
' move/copy the db file to the new location. 

End Sub 

Sub InitSheetRoot(sheet) 
  'root sheet init' 

  Dim ui, ini, edt 
  Set UI = SDB.ui 

  Dim RootInfo 
  Set RootInfo = UI.NewLabel(sheet) 
  RootInfo.Alignment = 0 
  RootInfo.Common.SetRect 10, 10, 400, 20 
  RootInfo.Caption = "The TweakMonkey Advanced Options Panel" _ 
    & VBLF & "Click a sub-tree to view/set options" _ 
    & VBLF _ 
    & VBLF & "Version: " & Version _ 
    & VBLF & "Last Updated: " & Updated 
  
End Sub 

Sub SaveSheetRoot(sheet) 
  'root sheet save' 
  'info panel only, nothing to save' 

End Sub 

Sub InitSheetAutoExec(sheet) 
  'autoexec sheet init' 
  Dim Volume, edt, ui, ini 
  Set ui = SDB.ui    
  Set ini = SDB.IniFile 

  set edt = UI.NewLabel(sheet) 
  edt.Alignment = 0 
  edt.Common.SetRect 10, 10, 400, 20 
  edt.Caption = "These options turn features on/off at startup." 

' Startup Volume control' 
  Set edt = UI.NewSpinEdit(sheet) 
  edt.Common.ControlName = "Volume" 
  edt.Common.SetRect 10, 30, 45, 20 
  edt.MinValue = 1 
  edt.MaxValue = 100 
  edt.Common.Hint = "Set Volume at startup" 
  
  Volume = ini.StringValue("TweakMonkey", "Volume") 
  If Volume = "" Then 
    edt.Value = 50 
      else edt.value = Volume 
  End If 

  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.SetRect 70, 30, 300, 20 
  edt.Caption = "Player Startup &Volume" 
  edt.Common.ControlName = "VolumeEnable" 
  edt.Common.Hint = "Enable/Disable the Startup Volume control" 
    
  If Volume = "" Then 
    edt.Checked = FALSE 
  Else 
    edt.Checked = TRUE 
  End If 

' Auto-play/resume checkboxes' 
  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.ControlName = "AutoPlay" 
  edt.Caption = "Auto &Play" 
  edt.Common.SetRect 10, 55, 80, 20 
  edt.Common.Hint = "Start Playing on startup" 
  
  Dim AutoPlay 
  AutoPlay = ini.StringValue("TweakMonkey", "AutoPlay") 
  If AutoPlay = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 
  
  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.ControlName = "AutoResume" 
  edt.Caption = "Auto &Resume (not yet functional)" 
  edt.Common.SetRect 80, 55, 200, 20 
  edt.Common.Hint = "Resume song from last play (not yet functional)" 
  
  Dim AutoResume 
  AutoResume = ini.StringValue("TweakMonkey", "AutoResume") 
  If AutoResume = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 

' Auto-Play-Playlist 
  Dim Playlist, LoadPlaylist 
  Playlist = ini.StringValue("TweakMonkey","Playlist") 
  LoadPlaylist =  ini.StringValue("TweakMonkey","LoadPlaylist") 

  Set edt = UI.NewCheckBox(Sheet) 
  edt.Common.SetRect 10, 75, 200, 20 
  edt.Caption = "&Load alternate playlist at startup" 
  edt.Common.ControlName = "LoadPlaylist" 
  edt.Common.Hint = "Load this playlist at startup (not yet functional)" 

  If LoadPlaylist = "True" AND Playlist <> "" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 
    
  Set edt = UI.NewEdit(Sheet) 
  edt.Common.SetRect 10, 100, 300, 20 
  edt.Common.ControlName = "Playlist" 
  If Playlist <> "" Then 
    edt.Text = Playlist 
'   Else 
'     Sheet.Common.ChildControl.("LoadPlaylist").Checked = False 
  End If 
  
  Set edt = UI.NewButton(Sheet) 
  edt.Caption = "Choose Playlist" ' (not yet functional) 
  edt.Common.Top = 98 
  edt.Common.Left = 320 
  edt.Common.Width = 100 
  edt.OnClickFunc = "" 'MsgBox ("Not yet implemented, sorry!") 

' Auto-Randomize the playlist or Now Playing' 
  Set edt = UI.NewCheckBox(Sheet) 
  edt.Common.SetRect 210, 75, 200, 20 
  edt.Caption = "R&andomize the playlist at startup" 
  edt.Common.ControlName = "AutoRandomize" 
  edt.Common.Hint = "Randomize the selected playlist or 'Now Playing' at startup (not yet functional)" 

  Dim AutoRandomize 
  AutoRandomize = ini.StringValue("TweakMonkey", "AutoRandomize") 
  If AutoRandomize = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 
  
' Player Auto-Shuffle' 
  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.ControlName = "AutoShuffle" 
  edt.Caption = "Auto Player &Shuffle" 
  edt.Common.SetRect 10, 130, 120, 20 
  edt.Common.Hint = "Set's Player Shuffle on at startup" 
  
  Dim AutoShuffle 
  AutoShuffle = ini.StringValue("TweakMonkey", "AutoShuffle") 
  If AutoShuffle = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 

' Player Auto-Repeat' 
  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.ControlName = "AutoRepeat" 
  edt.Caption = "Auto Player Rep&eat" 
  edt.Common.SetRect 150, 130, 120, 20 
  edt.Common.Hint = "Set's Player Repeat on at startup" 
  
  Dim AutoRepeat 
  AutoRepeat = ini.StringValue("TweakMonkey", "AutoRepeat") 
  If AutoRepeat = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 

' Add Explore this folder context menus' 
  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.ControlName = "ExploreFolder" 
  edt.Caption = "Add E&xplore this Folder" 
  edt.Common.SetRect 10, 160, 180, 20 
  edt.Common.Hint = "This will add an 'Explore this folder' context menu" _ 
    & " (not yet functional)" 
  
  Dim ExploreFolder 
  ExploreFolder = ini.StringValue("TweakMonkey", "ExploreFolder") 
  If ExploreFolder = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 

' Add Command Prompt this folder context menus' 
  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.ControlName = "CommandFolder" 
  edt.Caption = "Add &Command Prompt this Folder" 
  edt.Common.SetRect 150, 160, 180, 20 
  edt.Common.Hint = "This will add an 'Open a Command Prompt' context menu" _ 
    & " (not yet functional)" 
  
  Dim CommandFolder 
  CommandFolder = ini.StringValue("TweakMonkey", "CommandFolder") 
  If CommandFolder = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 
  
' Clear Now Playing' 
  Set edt = UI.NewCheckBox(sheet) 
  edt.Common.ControlName = "ClearNowPlaying" 
  edt.Caption = "Clear the Now Playing list at startup " _ 
    + "(Be careful this prevents auto-play!)" 
  edt.Common.SetRect 10, 300, 400, 20 
  edt.Common.Hint = "This will clear the 'Now Playing' of tracks at startup" 
  
  Dim ClearNowPlaying 
  ClearNowPlaying = ini.StringValue("TweakMonkey", "ClearNowPlaying") 
  If ClearNowPlaying = "True" Then 
    edt.Checked = TRUE 
  Else 
    edt.Checked = FALSE 
  End If 
End Sub 

Sub SaveSheetAutoExec(sheet) 
  'autoexec sheet save' 
  Dim ini, VolumeEnable, Volume, AutoPlay, AutoResume, LoadPlaylist, Playlist 
  Dim ClearNowPlaying, AutoShuffle, AutoRepeat 
  Set ini = SDB.IniFile 

' Save volume' 
  If Sheet.Common.ChildControl ("VolumeEnable").Checked = True Then 
    ini.StringValue("TweakMonkey","Volume") = Sheet.Common.ChildControl _ 
      ("Volume").Value 
  Else 
    ini.StringValue("TweakMonkey","Volume") = "" 
  End If 
          
' Save auto-play/resume' 
  ini.StringValue("TweakMonkey","AutoPlay") = Sheet.Common.ChildControl _ 
    ("AutoPlay").Checked 
  ini.StringValue("TweakMonkey","AutoResume") = Sheet.Common.ChildControl _ 
    ("AutoResume").Checked 

' Save LoadPlaylist and Playlist' 
  LoadPlaylist = Sheet.Common.ChildControl ("LoadPlaylist").Checked 
  Playlist = Sheet.Common.ChildControl ("Playlist").Text 
  
  If Playlist = "" Then 
    ini.StringValue("TweakMonkey","LoadPlaylist") = "False" 
  Else 
    ini.StringValue("TweakMonkey","LoadPlaylist") = LoadPlaylist 
  End If 
    
  ini.StringValue("TweakMonkey","Playlist") = Playlist 

' Save Auto-Randomize playlist' 
  ini.StringValue("TweakMonkey","AutoRandomize") = Sheet.Common.ChildControl _ 
    ("AutoRandomize").Checked 

' Save Auto-Shuffle' 
  ini.StringValue("TweakMonkey","AutoShuffle") = Sheet.Common.ChildControl _ 
    ("AutoShuffle").Checked 

' Save Auto-Repeat' 
  ini.StringValue("TweakMonkey","AutoRepeat") = Sheet.Common.ChildControl _ 
    ("AutoRepeat").Checked 

' Save ExploreFolder' 
  ini.StringValue("TweakMonkey","ExploreFolder") = Sheet.Common.ChildControl _ 
    ("ExploreFolder").Checked 

' Save CommandFolder' 
  ini.StringValue("TweakMonkey","CommandFolder") = Sheet.Common.ChildControl _ 
    ("CommandFolder").Checked 
  
' Save Clear Now Playing'  
  ini.StringValue("TweakMonkey","ClearNowPlaying") = Sheet.Common.ChildControl _ 
    ("ClearNowPlaying").Checked 
    
End Sub 

Sub InitSheetTree(sheet) 
  'tree sheet init' 
  Dim Position, ui, ini, vis, Visible, Expanded, exp, lbl, edt 
  Set ui = SDB.ui    
  Set ini = SDB.IniFile 

  Set lbl = UI.NewLabel(sheet) 
  lbl.Common.SetRect 10, 10, 80, 20 
  lbl.Caption = "Configure Nodes at startup: (Restart MM to take effect)" 
  lbl.Autosize = True 
  lbl.Alignment = 0 

' Startup Node' 
  Set edt = UI.NewLabel(sheet) 
  edt.Common.SetRect 140, 30, 100, 20 
  edt.Caption = "Node to be selected at startup" 
  edt.Autosize = True 
  edt.Alignment = 0 

  Set edt = UI.NewDropdown(sheet) 
  edt.Style = 2 
  edt.Common.ControlName = "StartupNode" 
  edt.Common.Left = 8 
  edt.Common.Top = 26  
  edt.Common.Hint = "MM will start with this node selected" 
  
  Dim StartupNode, Node, NodeIndex 
  StartupNode = ini.StringValue("TweakMonkey","StartupNode") 
  NodeIndex = 0 
  For Each Node in NodeArray 
    edt.AddItem(Node) 
    If Node = StartupNode Then 
      edt.ItemIndex = NodeIndex 
    End if 
    NodeIndex = NodeIndex + 1 
  Next 
  If StartupNode = "" Then 
    edt.ItemIndex = 1 
  End If 

  NodeIndex = 0 
  Position = 50 
  For Each Node in NodeArray 
  
    Set lbl = UI.NewLabel(sheet) 
    lbl.Common.SetRect 10, Position, 80, 20 
    lbl.Caption = Node 
    lbl.Autosize = True 
    lbl.Alignment = 0 

    Set vis = UI.NewCheckBox(sheet) 
    vis.Common.ControlName = Node & "Visible" 
    vis.Caption = "Visible" 
    vis.Common.SetRect 100, Position, 120, 20 
    vis.Common.Hint = "This will hide/unhide the " & Node & " Node" 
      
    Set exp = UI.NewCheckBox(sheet) 
    exp.Common.ControlName = Node & "Expanded" 
    exp.Caption = "Expanded" 
    exp.Common.SetRect 160, Position, 140, 20 
    If NodeIndex = 0 Then 
      exp.Common.SetRect 0,0,0,0 
    Else 
      exp.Common.Hint = "This will expand/contract the " & Node & " Node" 
    End if 
    
    Visible = ini.StringValue("Tree", Node) 
    Expanded = ini.StringValue("TweakMonkey", Node & "Expanded") 
    
    If StartupNode = Node Then 
      Visible = "1" 
    End If 
    
    If Visible = "0" Then 
      vis.Checked = FALSE 
    Else 
      vis.Checked = TRUE 
    End If 
    If Expanded = "True" Then 
      exp.Checked = True 
    Else 
      
      exp.Checked = False 
    End IF 
    Position = Position + 16 
    NodeIndex = NodeIndex + 1 
  Next 
End Sub 

Sub SaveSheetTree(sheet) 
  'tree sheet save' 
  Dim Node, Position, ui, ini, vis, Visible, Expanded, exp, lbl, StartupNode 

  Set ui = SDB.ui    
  Set ini = SDB.IniFile 

' Save startup node' 
  StartupNode = NodeArray(Sheet.Common.ChildControl ("StartupNode").ItemIndex) 
  ini.StringValue("TweakMonkey","StartupNode") = StartupNode 

' Save visible/expanded node options'  
  Dim NodeIndex 
  NodeIndex = 0 
  For Each Node in NodeArray 
    If Sheet.Common.ChildControl(Node & "Visible").Checked = True Then 
      ini.StringValue("Tree", Node) = "1" 
    Else 
      If StartupNode = Node Then 
        ini.StringValue("Tree", Node) = "1" 
      Else 
        ini.StringValue("Tree", Node) = "0" 
      End If 
    End If 
    
    Expanded = Sheet.Common.ChildControl(Node & "Expanded").Checked 
    If StartupNode = Node Then 
      If NodeIndex => 2 OR NodeIndex <= 11 Then 
        ini.StringValue("Tree","Library") = "1" 
        ini.StringValue("TweakMonkey","LibraryExpanded") = "True" 
      End If 
    End If 
    ini.StringValue("TweakMonkey", Node & "Expanded") = Expanded 
    NodeIndex = NodeIndex + 1 
  Next 
End Sub 

' TODO Context menu functions' 
Sub ExploreFolder 
  'add code to check context and open an explorer window' 
End Sub 

Sub CommandFolder 
  'add code to check context and open a command prompt window' 
End Sub

Lowlander
Posts: 44175
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Post by Lowlander » Tue May 30, 2006 11:32 am

You guys should consider integrating the MagicNodes script as well. So you can create/manage MagicNodes directly in the options of TweakMonkey.
Another thing to consider is to allow sorting of (magic)nodes.

Finally an installer which has options to install FavoriteNodes, StartupNodes and MagicNodes when installing TweakMonkey. TweakMonkey could be the parent to all these other scripts.
Lowlander (MediaMonkey user since 2003)

rovingcowboy
Posts: 14153
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Tue May 30, 2006 11:38 am

Lowlander wrote:You guys should consider integrating the MagicNodes script as well. So you can create/manage MagicNodes directly in the options of TweakMonkey.
Another thing to consider is to allow sorting of (magic)nodes.

Finally an installer which has options to install FavoriteNodes, StartupNodes and MagicNodes when installing TweakMonkey. TweakMonkey could be the parent to all these other scripts.
i'll second that i still can't figure out magic nodes? :o
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Wed May 31, 2006 3:08 am

Begges wrote a GUI for magic nodes, maybe you could consult with him about integrating it with this script.

FastNode GUI: http://www.mediamonkey.com/forum/viewtopic.php?t=9692
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

LtImDeadmeat

With-out you lot I'd be lost...

Post by LtImDeadmeat » Sun Jun 11, 2006 7:20 am

If it was not for people like you lot I would be lost in this world of scripting/coding etc... but then I am already lost...lol....GREAT WORK FOLKS.!!!... But how/where could a true lame-man (lay-man) learn all about basic coding and scripting... Just I have so many ideas and no means of producing anything as I am lost in all this cc bb etc code... any advice would be greatly accepted. Please note though, a Noobie would probably understand more about coding than I, hence you need to talk to me as if I were 5 years old.....lol..... :oops: :-? Thanks.

rovingcowboy
Posts: 14153
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Re: With-out you lot I'd be lost...

Post by rovingcowboy » Sun Jun 11, 2006 7:54 am

LtImDeadmeat wrote:If it was not for people like you lot I would be lost in this world of scripting/coding etc... but then I am already lost...lol....GREAT WORK FOLKS.!!!... But how/where could a true lame-man (lay-man) learn all about basic coding and scripting... Just I have so many ideas and no means of producing anything as I am lost in all this cc bb etc code... any advice would be greatly accepted. Please note though, a Noobie would probably understand more about coding than I, hence you need to talk to me as if I were 5 years old.....lol..... :oops: :-? Thanks.

wow did you pick a code to mess you up. to try and learn from. this magic nodes is one hard code to learn.

i suggest going to the all scripts thread.
start with the first couple posted scripts. read their discription to see what they do.
go to that scripts message thread. and read the script's code.

go back and forth with the description and the code source until you understand what the script does.

then go back to the all scripts thread and start with the next script in line.
and do the same for it.

learn each one if you can. but if the scripts are large like this one skip it and go to the next one until you find a small script to learn, then learn with the small ones first.

also don't beafraid to ask for a script to be made. if some one makes it for you. then you will be able to understand that script faster since it does what you asked for.

one other thing is remember these scripts are for media monkey and thus mainly work in only media monkey.

there are some authors here that can help you learn how to make other scripts for use out side of monkey, but don't ask for that in the forum.. it is best to ask them in PM's or Email.

that way we keep this forum for monkey only.
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Sun Jun 11, 2006 8:29 am

Just a clarification: Begges's "FastNode GUI" script is no GUI for the "Magic Nodes" script. However, it's a nice addition to it and requires the MagicNodes script to be installed too. Just look at the script's thread & description to get more info.



@LtImDeadmeat and other interested people:
Feel free to ask for any help you need. It's (as RovingCowboy already mentioned) important to start "understanding" the smaller scripts first, as you might get overwhelmed by the longer scripts (which are not necessarily more difficult, you know).

A good advice: start learning the "pure" scripts first. All (non-pure) scripts that have html in them (e.g. scripts that offer a preview for tag changes) are very long and mostly way too "complicated" for what they only do (but hey, there's not other way to implement previews). Once it's your time to explore them, you'll see that these scripts look difficult, but in reality aren't at all (examples are the "(Title)Case", "Fix Trailing The", "Find Missing The", "Split Artist Title", "PersonalTagEnhancer", ...).
That last script is mine, so I know what I'm talking about...

Also, be sure to understand the MediaMonkey program itself advanced enough: where is the database stored (and what are/contain the tables), where is the configuration ini file stored, how are all scripts installed, how do you use the scripts.ini file, how does the new event mechanism work (Script.RegisterEvent .....), what toolbars can I use, what functionality/scripts (already) exist, ... Of course, your necessary knowledge depends on what you'd like to script.

Probably one of the best guidelines for newbies: use a good text editor (script editor) which has VBScript syntax highlighting. And learn from scripts that look good and follow the programming practices (everything nicely indented, starting with capital letters, consistency, fast but easy to understand code, split long code in separate subs and functions, declare variables where they are used (and not in the front of the file/method), ...).

One of the most beautiful programming can be found in the "MagicNodes" script (clean and clever code) by Pablo, unfortunately it's much code for a starter. Reading such nice coding will relieve the headaches you can get from reading some other, less orderly scripts. :wink:

BTW: There's a reason why I mention my MSN address here: you can always chat if you have a question (I'm not online very much however, but for that there's e-mail and PM off course).

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).

pietzke
Posts: 161
Joined: Sun Sep 25, 2005 7:43 am

Post by pietzke » Sat Jul 01, 2006 4:39 pm

Hello,

nice script, but I can't manage the Radio- and the web-node to disapear. For the other ones it works fine, but after restart MM these two are checked as visible again. Any Idea?

Thanx for the great scripting again!

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Sat Jul 01, 2006 5:51 pm

You can hide these in the standard MM Appearance settings.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

pietzke
Posts: 161
Joined: Sun Sep 25, 2005 7:43 am

Post by pietzke » Sat Jul 01, 2006 6:24 pm

Uhh, yeah that's it, of course.
Thanx

pietzke
Posts: 161
Joined: Sun Sep 25, 2005 7:43 am

Post by pietzke » Mon Jul 03, 2006 2:58 pm

I love my tree to be clear, and as I customized my Artist and Album nodes with MagicNodes, I switched the original nodes to invisible. Well done for this! But I just experienced, that 'Find More from Same Artist' would not work anymore, if the original Artist Node is hidden. Same thig with Album. Is it possible to get it work some way?

Another thing:
The two Additions "Command Promt this Folder" and "Explorer this Folder" cause an "OLE error 800A01C2" on my System.

Teknojnky
Posts: 5523
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon Jul 03, 2006 3:28 pm

the command prompt and explore this folder were a work in progress that never got completed, its probly better to disable them, I shouldn't have included those until they were working.

I would guess the 'find more' isn't working properly because they are coded to go to the appliciable node... which of course if you have hidden it, is no longer available.

I do not think its possible to 'find more' to a magic node, but perhaps more knowledgable scripters can think of a way.

So, if you want to use the 'find more from', you will have make that node visable.

pietzke
Posts: 161
Joined: Sun Sep 25, 2005 7:43 am

Post by pietzke » Mon Jul 03, 2006 3:50 pm

Teknojnky wrote:the command prompt and explore this folder were a work in progress that never got completed, its probly better to disable them, I shouldn't have included those until they were working.
Yes, thanks, good to know. Thought it was me again :lol:
Teknojnky wrote:So, if you want to use the 'find more from', you will have make that node visable.
Well, I feared for this answer, but I guess you are right. :cry:

Post Reply