Posted: 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?


The Music Manager for Serious Collectors
http://www.mediamonkey.com/forum/
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
i'll second that i still can't figure out magic nodes?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.
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.....![]()
Thanks.
Yes, thanks, good to know. Thought it was me againTeknojnky 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.
Well, I feared for this answer, but I guess you are right.Teknojnky wrote:So, if you want to use the 'find more from', you will have make that node visable.