by Just Guessing » Thu Oct 04, 2012 12:35 pm
Well look, heres an AUTO folder script to offer an alternate star ratings system ("AltStar") for immediate use. It is currently set to use field CUSTOM1. Tweak that in the top of the script.
PROS:
- its free.
- its here now.
- the 'ratings' could be translated/transfered down the road to a better ratings system, if one shows up.
CONS:
- I dont know whats needed to offer backward compatability. I'm on MM4, and thats all I know about. Maybe it breaks on MM3 etc.
- These 'icons' are UNICODE characters. I always expect unicode to someday cause some grief somewhere. Its not ideal. I have seen options where tags are not permited to even have unicode. Obviously thats an issue. Also, different font useage/skin font selections could potentially destroy the idea. One could try different unicode characters as a solution if needed.
- As a font, the now-playing selection is increased in size, making that one track look like it has more 'stars' than it actually does, but only temporarily.
- The panel should also be rewritten in HTML and made prettier. Use icons instead of numeric buttons as well. Maybe later, or perhaps someone else wants to fix that up?
BTW, does anybody know if MM can give a BACKCOLOR/BACKGROUND COLOR to a generic dockable panel. I tried many ideas and never found the functionality.
I did implement a 'view menu' option to remove the panel header once you have it where you want it. I can't figure out why I haven't seen anyone else do this. I hate the wasted space, small as it is. Its just completely unecessary (in MM4 anyway) to go to the buried user.ini file and find line 1023 or whatever and hard code a visibility option. Just hit the option in the view sub menu. Breezy - easy - make it go away - bring it back - repeat - until its just no fun anymore!
So its 10 simple buttons. Enter your ratings choice IN THE PANEL ONLY for full column integrity (though its not critical). The radio buttons to the right in the panel are for writing the stars to
- 1) the single currently playing song,
- 2) SELECTED/multiple songs.
The labels for these buttons are in unicode also, if they look wrong on your system. Thats a fix that could go lots of easy directions if its failing on your system.
Code: Select all
'==========================================================================
'--------------AltStar 1.0 by Just Guessing aka KingDavidCaul--------------
' --- for MM4 - maybe others. Just a workaround till second star system ---
' --- hopefully implemented. Different Skins will use different fonts -----
' --- and systems will have different fonts. Thats gonna make problems. ---
' --- Also, these are unicode characters. Some will have these prohibited -
' --- in their tags. Only way to nicely fix this is to get code to -------
' --- access the main panel and use icons. Never seen that done that I ---
'---------------noticed. Sorry. ------------------------------------------
'==========================================================================
Private Const AltStarTag = "Custom1" ' change this to a tag you consider unused
Private Const AltStarSTAR = &H25c6 ' might otherwise want &H2605 = star, &H2588 = block, &H25c6 = diamond
Private Const AltStarShowToolbarOption = True ' change if dont want toolbar button
Private Const AltStarFontColor = &H730207 ' will have to lookup color to match personal skin used
Private Const AltStarFontSize = 6 ' button font size
Private Const AltStarPadding = 3 ' space between buttons
Private Const AltStarFontwidth = 6 ' if changing font size creates squeezed look
Private Const AltStarBtnPadding = 8 ' inner button padding
Private Const AltStarBtnTopMargin = 6 ' space above button
Private Const AltStarBtnHeight = 25
' -------------------------------------------------tweak above
Dim AltStarMenu, AltStarMenuShow, AltStarPanel, UI, AltStarHeaderOption
Set UI = SDB.UI
Sub OnStartup
If AltStarShowToolbarOption = True Then
Dim AltStarBox : Set AltStarBox = UI.AddMenuItem(UI.Menu_TbStandard, 0, 0)
AltStarBox.Caption = "AltStar"
AltStarBox.UseScript = Script.ScriptPath
AltStarBox.Checked = True
Script.RegisterEvent AltStarBox, "OnClick", "AltStarShowPanel"
End If
Set AltStarMenu = UI.AddMenuItemSub(UI.Menu_View, 0, 0)
AltStarMenu.Caption = "AltStar"
Set AltStarMenuShow = UI.AddMenuItem(AltStarMenu, 0, 0)
AltStarMenuShow.Caption = "Show it?"
AltStarMenuShow.Checked = True
Script.RegisterEvent AltStarMenuShow, "OnClick", "AltStarShowPanel"
Set AltStarHeaderOption = UI.AddMenuItem(AltStarMenu, 0, 0)
AltStarHeaderOption.Caption = "Show titlebar?"
AltStarHeaderOption.Checked = False
SDB.Objects("AltStarHeaderOption") = AltStarHeaderOption
Script.RegisterEvent AltStarHeaderOption, "OnClick", "AltStarGetsHeader"
MakeAltStarPanel
End Sub
Sub AltStarGetsHeader(o)
If SDB.Objects("AltStarHeaderOption").Checked Then
SDB.Objects("AltStarHeaderOption").Checked = False
Else
SDB.Objects("AltStarHeaderOption").Checked = True
End If
MakeAltStarPanel
End Sub
Sub MakeAltStarPanel
Set AltStarPanel = UI.NewDockablePersistentPanel("AltStar")
If AltStarPanel.IsNew Then
AltStarPanel.DockedTo = 1 : AltStarPanel.Common.Width = 250 : AltStarPanel.Common.Height = AltStarBtnHeight + (AltStarBtnTopMargin * 3)
End If
If SDB.Objects("AltStarHeaderOption").Checked Then
AltStarPanel.ShowCaption = True : AltStarPanel.Caption = "AltStar"
Else
AltStarPanel.ShowCaption = 0
End If
Script.RegisterEvent AltStarPanel, "OnClose", "AltStarPanelClose"
Dim AltStarBtn, AltStarBtnCoX, AltStarBtnWidth, AltStarRadio1, AltStarRadio2
AltStarBtnCoX = AltStarPadding * 2
For i = 1 To 10
Set AltStarBtn = UI.NewButton(AltStarPanel)
AltStarBtn.Common.ControlName = "AltStarBtn"
AltStarBtn.Caption = i
AltStarBtnWidth = (Len(AltStarBtn.Caption) * AltStarFontWidth) + AltStarBtnPadding
AltStarBtn.Common.SetRect AltStarBtnCoX, AltStarBtnTopMargin, AltStarBtnWidth, AltStarBtnHeight
AltStarBtn.Common.FontColor = AltStarFontColor
AltStarBtn.Common.FontSize = AltStarFontSize
AltStarBtn.Common.FontBold = True
Script.RegisterEvent AltStarBtn.Common, "OnClick", "AltStarBtnClick"
AltStarBtnCoX = AltStarBtnCoX + AltStarBtnWidth + AltStarPadding
Next
Set AltStarRadio2 = UI.NewRadioButton(AltStarPanel)
AltStarRadio2.Common.SetRect AltStarBtnCoX, 4, 35, 13
AltStarRadio2.Caption = ChrW(&H2212)
AltStarRadio2.Common.FontBold = True
AltStarRadio2.Common.FontSize = 15
AltStarRadio2.Checked = True
AltStarRadio2.Common.ControlName = "AltStarOnly"
Set AltStarRadio1 = UI.NewRadioButton(AltStarPanel)
AltStarRadio1.Common.SetRect AltStarBtnCoX, 18, 35, 13
AltStarRadio1.Caption = ChrW(&H2630)
AltStarRadio1.Common.FontBold = True
AltStarRadio1.Common.FontSize = 9
AltStarRadio1.Checked = False
AltStarRadio1.Common.ControlName = "AltStarAny"
End Sub
Sub AltStarShowPanel(Item)
AltStarPanel.Common.Visible = Not AltStarPanel.Common.Visible
AltStarMenu.Checked = AltStarPanel.Common.Visible
End Sub
Sub AltStarPanelClose(Item)
AltStarMenu.Checked = False
End Sub
Sub AltStarBtnClick(AltStarBtn)
If AltStarPanel.Common.ChildControl("AltStarAny").Checked Then
If SDB.SelectedSongList.count = 0 Then
SDB.MessageBox "Select tracks to be updated", mtError, Array(mbOk)
Exit Sub
End If
Dim AltStarSongsList, AltStarItems, i, AltStarOldTags, AltStarNewTags, AltStarAddToTags
Set AltStarSongsList = SDB.SelectedSongList
For i = 0 To AltStarSongsList.count - 1
Set AltStarItems = AltStarSongsList.Item(i)
Execute("AltStarItems."&AltStarTag&" = String(AltStarBtn.Caption,ChrW(AltStarSTAR))")
AltStarItems.UpdateDB
Next
AltStarSongsList.UpdateAll
Exit Sub
End If
If AltStarPanel.Common.ChildControl("AltStarOnly").Checked Then
Dim AltStarCurrentSong, AltStarSongList
Set AltStarSongList = SDB.NewSongList
Set AltStarCurrentSong = SDB.Player.CurrentSong
AltStarSongList.Add(AltStarCurrentSong)
Execute("AltStarCurrentSong."&AltStarTag&" = String(AltStarBtn.Caption,ChrW(AltStarSTAR))")
AltStarSongList.UpdateAll
Set AltStarSongList = Nothing : Set AltStarCurrentSong = Nothing
End If
End Sub
Well look, heres an AUTO folder script to offer an alternate star ratings system ("AltStar") for immediate use. It is currently set to use field CUSTOM1. Tweak that in the top of the script.
PROS:
[list][*]its free.
[*]its here now.
[*]the 'ratings' could be translated/transfered down the road to a better ratings system, if one shows up.[/list]
CONS:
[list][*]I dont know whats needed to offer backward compatability. I'm on MM4, and thats all I know about. Maybe it breaks on MM3 etc.
[*]These 'icons' are UNICODE characters. I always expect unicode to someday cause some grief somewhere. Its not ideal. I have seen options where tags are not permited to even have unicode. Obviously thats an issue. Also, different font useage/skin font selections could potentially destroy the idea. One could try different unicode characters as a solution if needed.
[*]As a font, the now-playing selection is increased in size, making that one track look like it has more 'stars' than it actually does, but only temporarily.
[*]The panel should also be rewritten in HTML and made prettier. Use icons instead of numeric buttons as well. Maybe later, or perhaps someone else wants to fix that up?[/list]
[u]BTW, does anybody know if MM can give a BACKCOLOR/BACKGROUND COLOR to a generic dockable panel.[/u] I tried many ideas and never found the functionality.
I did implement a 'view menu' option to remove the panel header once you have it where you want it. I can't figure out why I haven't seen anyone else do this. I hate the wasted space, small as it is. Its just completely unecessary (in MM4 anyway) to go to the buried user.ini file and find line 1023 or whatever and hard code a visibility option. Just hit the option in the view sub menu. Breezy - easy - make it go away - bring it back - repeat - until its just no fun anymore!
So its 10 simple buttons. Enter your ratings choice IN THE PANEL ONLY for full column integrity (though its not critical). The radio buttons to the right in the panel are for writing the stars to
[list][*]1) the single currently playing song,
[*]2) SELECTED/multiple songs. [/list]
The labels for these buttons are in unicode also, if they look wrong on your system. Thats a fix that could go lots of easy directions if its failing on your system.
[code]'==========================================================================
'--------------AltStar 1.0 by Just Guessing aka KingDavidCaul--------------
' --- for MM4 - maybe others. Just a workaround till second star system ---
' --- hopefully implemented. Different Skins will use different fonts -----
' --- and systems will have different fonts. Thats gonna make problems. ---
' --- Also, these are unicode characters. Some will have these prohibited -
' --- in their tags. Only way to nicely fix this is to get code to -------
' --- access the main panel and use icons. Never seen that done that I ---
'---------------noticed. Sorry. ------------------------------------------
'==========================================================================
Private Const AltStarTag = "Custom1" ' change this to a tag you consider unused
Private Const AltStarSTAR = &H25c6 ' might otherwise want &H2605 = star, &H2588 = block, &H25c6 = diamond
Private Const AltStarShowToolbarOption = True ' change if dont want toolbar button
Private Const AltStarFontColor = &H730207 ' will have to lookup color to match personal skin used
Private Const AltStarFontSize = 6 ' button font size
Private Const AltStarPadding = 3 ' space between buttons
Private Const AltStarFontwidth = 6 ' if changing font size creates squeezed look
Private Const AltStarBtnPadding = 8 ' inner button padding
Private Const AltStarBtnTopMargin = 6 ' space above button
Private Const AltStarBtnHeight = 25
' -------------------------------------------------tweak above
Dim AltStarMenu, AltStarMenuShow, AltStarPanel, UI, AltStarHeaderOption
Set UI = SDB.UI
Sub OnStartup
If AltStarShowToolbarOption = True Then
Dim AltStarBox : Set AltStarBox = UI.AddMenuItem(UI.Menu_TbStandard, 0, 0)
AltStarBox.Caption = "AltStar"
AltStarBox.UseScript = Script.ScriptPath
AltStarBox.Checked = True
Script.RegisterEvent AltStarBox, "OnClick", "AltStarShowPanel"
End If
Set AltStarMenu = UI.AddMenuItemSub(UI.Menu_View, 0, 0)
AltStarMenu.Caption = "AltStar"
Set AltStarMenuShow = UI.AddMenuItem(AltStarMenu, 0, 0)
AltStarMenuShow.Caption = "Show it?"
AltStarMenuShow.Checked = True
Script.RegisterEvent AltStarMenuShow, "OnClick", "AltStarShowPanel"
Set AltStarHeaderOption = UI.AddMenuItem(AltStarMenu, 0, 0)
AltStarHeaderOption.Caption = "Show titlebar?"
AltStarHeaderOption.Checked = False
SDB.Objects("AltStarHeaderOption") = AltStarHeaderOption
Script.RegisterEvent AltStarHeaderOption, "OnClick", "AltStarGetsHeader"
MakeAltStarPanel
End Sub
Sub AltStarGetsHeader(o)
If SDB.Objects("AltStarHeaderOption").Checked Then
SDB.Objects("AltStarHeaderOption").Checked = False
Else
SDB.Objects("AltStarHeaderOption").Checked = True
End If
MakeAltStarPanel
End Sub
Sub MakeAltStarPanel
Set AltStarPanel = UI.NewDockablePersistentPanel("AltStar")
If AltStarPanel.IsNew Then
AltStarPanel.DockedTo = 1 : AltStarPanel.Common.Width = 250 : AltStarPanel.Common.Height = AltStarBtnHeight + (AltStarBtnTopMargin * 3)
End If
If SDB.Objects("AltStarHeaderOption").Checked Then
AltStarPanel.ShowCaption = True : AltStarPanel.Caption = "AltStar"
Else
AltStarPanel.ShowCaption = 0
End If
Script.RegisterEvent AltStarPanel, "OnClose", "AltStarPanelClose"
Dim AltStarBtn, AltStarBtnCoX, AltStarBtnWidth, AltStarRadio1, AltStarRadio2
AltStarBtnCoX = AltStarPadding * 2
For i = 1 To 10
Set AltStarBtn = UI.NewButton(AltStarPanel)
AltStarBtn.Common.ControlName = "AltStarBtn"
AltStarBtn.Caption = i
AltStarBtnWidth = (Len(AltStarBtn.Caption) * AltStarFontWidth) + AltStarBtnPadding
AltStarBtn.Common.SetRect AltStarBtnCoX, AltStarBtnTopMargin, AltStarBtnWidth, AltStarBtnHeight
AltStarBtn.Common.FontColor = AltStarFontColor
AltStarBtn.Common.FontSize = AltStarFontSize
AltStarBtn.Common.FontBold = True
Script.RegisterEvent AltStarBtn.Common, "OnClick", "AltStarBtnClick"
AltStarBtnCoX = AltStarBtnCoX + AltStarBtnWidth + AltStarPadding
Next
Set AltStarRadio2 = UI.NewRadioButton(AltStarPanel)
AltStarRadio2.Common.SetRect AltStarBtnCoX, 4, 35, 13
AltStarRadio2.Caption = ChrW(&H2212)
AltStarRadio2.Common.FontBold = True
AltStarRadio2.Common.FontSize = 15
AltStarRadio2.Checked = True
AltStarRadio2.Common.ControlName = "AltStarOnly"
Set AltStarRadio1 = UI.NewRadioButton(AltStarPanel)
AltStarRadio1.Common.SetRect AltStarBtnCoX, 18, 35, 13
AltStarRadio1.Caption = ChrW(&H2630)
AltStarRadio1.Common.FontBold = True
AltStarRadio1.Common.FontSize = 9
AltStarRadio1.Checked = False
AltStarRadio1.Common.ControlName = "AltStarAny"
End Sub
Sub AltStarShowPanel(Item)
AltStarPanel.Common.Visible = Not AltStarPanel.Common.Visible
AltStarMenu.Checked = AltStarPanel.Common.Visible
End Sub
Sub AltStarPanelClose(Item)
AltStarMenu.Checked = False
End Sub
Sub AltStarBtnClick(AltStarBtn)
If AltStarPanel.Common.ChildControl("AltStarAny").Checked Then
If SDB.SelectedSongList.count = 0 Then
SDB.MessageBox "Select tracks to be updated", mtError, Array(mbOk)
Exit Sub
End If
Dim AltStarSongsList, AltStarItems, i, AltStarOldTags, AltStarNewTags, AltStarAddToTags
Set AltStarSongsList = SDB.SelectedSongList
For i = 0 To AltStarSongsList.count - 1
Set AltStarItems = AltStarSongsList.Item(i)
Execute("AltStarItems."&AltStarTag&" = String(AltStarBtn.Caption,ChrW(AltStarSTAR))")
AltStarItems.UpdateDB
Next
AltStarSongsList.UpdateAll
Exit Sub
End If
If AltStarPanel.Common.ChildControl("AltStarOnly").Checked Then
Dim AltStarCurrentSong, AltStarSongList
Set AltStarSongList = SDB.NewSongList
Set AltStarCurrentSong = SDB.Player.CurrentSong
AltStarSongList.Add(AltStarCurrentSong)
Execute("AltStarCurrentSong."&AltStarTag&" = String(AltStarBtn.Caption,ChrW(AltStarSTAR))")
AltStarSongList.UpdateAll
Set AltStarSongList = Nothing : Set AltStarCurrentSong = Nothing
End If
End Sub[/code]