View Manager v1.5 (08-10-08) [MM3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia
Contact:

View Manager v1.5 (08-10-08) [MM3]

Post by MoDementia »

No Longer Available
Last edited by MoDementia on Tue Feb 03, 2009 4:03 am, edited 5 times in total.
Deadman36g
Posts: 56
Joined: Tue Jun 12, 2007 11:32 pm
Contact:

Re: View Manager v1.2 (26-08-08) [MM3]

Post by Deadman36g »

Is it possible you could add a way to select None (Show all tracks) from the button as well (So i don't have to go through the options each time).
Image
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by MoDementia »

New Version

' 26-08-08 Version 1.3
' Added None (Show All Tracks)
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by nynaevelan »

What are the numbers in the parentheses??

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by MoDementia »

Filter IDs (Too lazy to store it somewhere else) :P
Last edited by MoDementia on Wed Aug 27, 2008 6:25 pm, edited 1 time in total.
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by nynaevelan »

Thank you, that helps. :D

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Deadman36g
Posts: 56
Joined: Tue Jun 12, 2007 11:32 pm
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by Deadman36g »

MoDementia wrote:New Version

' 26-08-08 Version 1.3
' Added None (Show All Tracks)
Thank you :)
Image
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by nynaevelan »

Is there a way to refresh the filter list without having to restart MM??

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by MoDementia »

Not without consequences.
There is no trigger for when filters are added or deleted.
The table would have to be interrogated every 30secs-1min to see if it had changed or on every play/selection which would be a waste of processing time given how rarely these are added / deleted.
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by nynaevelan »

Ok, I can live with a refresh when I remember to open/close MM. I do not want performance degraded because as you stated the filters are not changed that often, at least not in my db. Although now that I have a much better source to manage them, I am tempted to create some more.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by Bex »

I like this script! :D
MoDementia wrote:Not without consequences.
There is no trigger for when filters are added or deleted.
The table would have to be interrogated every 30secs-1min to see if it had changed or on every play/selection which would be a waste of processing time given how rarely these are added / deleted.
Actually, I think you can solve this by using the OnClickFunc on the Filters-menu, like this:

Code: Select all

  Set FilterMnu = SDB.UI.AddMenuItemSub(SubMnu,1,-1)
  FilterMnu.Caption = "Filters"
  FilterMnu.UseScript = Script.ScriptPath
  FilterMnu.OnClickFunc = "CreateFilterMenus"
And then create a sub which creates the menus:

Code: Select all

Sub CreateFilterMenus(OnMnu)
  Set iter = SDB.Database.OpenSQL("SELECT ID, Name FROM Filters ORDER BY Name")
  Do While NOT iter.EOF
    Set Mnu = SDB.UI.AddMenuItem(OnMnu,2,-1)
    Mnu.Caption = iter.StringByIndex(1) & " (" & iter.StringByIndex(0) & ")"
    Mnu.UseScript = Script.ScriptPath
    Mnu.IconIndex = SDB.RegisterIcon("Scripts\View Manager\Icons\table_refresh.ico",0)
    Script.RegisterEvent Mnu, "OnClick", "btnClickFilter"
  iter.Next
  Loop
  Set iter = Nothing
End sub
But it doesn't work correctly. You need to find a way to remove the old menus, you'll understand what I mean when you test it.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by MoDementia »

Thanks Bex,

I refresh the saved views by creating individual SDB.Objects for them and calling DestroyMenus before adding the menus. It would work for the code you suggested too.
However, I think that having to click "Filters" each time to get the sub menus and waiting for them to be rebuilt would be more annoying than restarting MM once in a while?

Code: Select all

    Sub CreateFilterMenus(OnMnu)
      Call DestroyFilterMenus
      Set StringList = SDB.NewStringList
      Set iter = SDB.Database.OpenSQL("SELECT ID, Name FROM Filters ORDER BY Name")
      Do While NOT iter.EOF
        Set Mnu = SDB.UI.AddMenuItem(OnMnu,2,-1)
        Mnu.Caption = iter.StringByIndex(1) & " (" & iter.StringByIndex(0) & ")"
        Mnu.UseScript = Script.ScriptPath
        Mnu.IconIndex = SDB.RegisterIcon("Scripts\View Manager\Icons\table_refresh.ico",0)
        Script.RegisterEvent Mnu, "OnClick", "btnClickFilter"
        Set SDB.Objects("Filter" & iter.StringByIndex(0)) = Mnu
        StringList.Add "Filter" & iter.StringByIndex(0)
      iter.Next
      Loop
      Set iter = Nothing
      Set SDB.Objects("VMFilterList") = StringList
    End sub

Sub DestroyFilterMenus
  Set StringList = SDB.Objects("VMFilterList")
  If NOT StringList Is Nothing Then
    For xCounter = 0 to StringList.Count - 1
      ThisObjectText = StringList.Item(xCounter)
      Set Mnu = SDB.Objects(ThisObjectText)
      Mnu.Checked = False
      Mnu.Visible = False
      Script.UnRegisterEvents Mnu
      Set Mnu = Nothing
      Set SDB.Objects(ThisObjectText) = Nothing
    Next
  End If
End Sub
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by Bex »

Yes, it takes annoyingly long time to create the menus but you could add a simple check and only recreate them if some have been added/deleted.

Add this to the OnStartup Sub:

Code: Select all

SDB.IniFile.IntValue("ViewManager","FilterCount")=SDB.Database.OpenSQL("SELECT Count(*) FROM Filters").valuebyindex(0)
And here's the new CreateFilterMenus sub:

Code: Select all

Sub CreateFilterMenus(OnMnu)
   FilterCount=SDB.Database.OpenSQL("SELECT Count(*) FROM Filters").valuebyindex(0)
   If Not SDB.IniFile.IntValue("ViewManager","FilterCount")=FilterCount Then Exit Sub
   Call DestroyFilterMenus
   Set StringList = SDB.NewStringList
   Set iter = SDB.Database.OpenSQL("SELECT ID, Name FROM Filters ORDER BY Name")
   Do While NOT iter.EOF
     Set Mnu = SDB.UI.AddMenuItem(OnMnu,2,-1)
     Mnu.Caption = iter.StringByIndex(1) & " (" & iter.StringByIndex(0) & ")"
     Mnu.UseScript = Script.ScriptPath
     Mnu.IconIndex = SDB.RegisterIcon("Scripts\View Manager\Icons\table_refresh.ico",0)
     Script.RegisterEvent Mnu, "OnClick", "btnClickFilter"
     Set SDB.Objects("Filter" & iter.StringByIndex(0)) = Mnu
     StringList.Add "Filter" & iter.StringByIndex(0)
   iter.Next
   Loop
   Set iter = Nothing
   Set SDB.Objects("VMFilterList") = StringList
   SDB.IniFile.IntValue("ViewManager","FilterCount")=FilterCount
End sub
You also need to add the create menu statement to the OnStartup sub.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by Bex »

I just tested it and it needs some more work but I'm sure you get the picture and sort it out! :D
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia
Contact:

Re: View Manager v1.3 (28-08-08) [MM3]

Post by MoDementia »

Hehehe I also thought about that , it doesn't work if you add and delete the same amount of filters i.e. you add 1 and delete 1 :(

I will try and do another version with an option to use either method.
Post Reply