View Issue Details

IDProjectCategoryView StatusLast Update
0018953MMW 5Extensions frameworkpublic2022-08-30 23:53
Reporterdrakinite Assigned To 
PriorityurgentSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version5.0.3 
Target Version5.0.4Fixed in Version5.0.3 
Summary0018953: Some COM methods not implemented
DescriptionEncountered a crash. I'm trying to add tracks to the current playlist like this:
1) call get_NewSongList
2) call the list's Add method with newly created SongData objects (Since I can't get pre-filled SongData objects - not sure which fields I need to set there - is ID sufficient?)
3) call PlaylistInsertTracks
This triggers a NPE in Data.TJSONPair.GetJsonValue. You should have a crash log with ID AB1A677C.

The following publicly documented methods of TSDBSongList are not implemented:
Add*
Insert
Get_Artists
Get_Albums
Delete
Get/Set_Item
UpdateAll

TSDBSongList.Add, as well as TSDBSongList.CreateEmpty, appear to be the cause of the crash as described in Ticket # 2159. The shared SongList object doesn't get transformed into the appropriate JSON, leading to a crash when being parsed.

For completeness' sake, this is a list of the methods that appear to not be implemented. I'm sure most of them can be ignored, but I don't know which ones should or shouldn't be prioritized.

MetadataFromFilename
ReadTags
ReadTagsAsExt
WriteTags
UpdateAlbum
UpdateArtist
Set_Mood
Set_Occasion
Set_Quality
Set_Tempo
Get/Set_Date
UpdateAll
UpdateDB
_Data
Get_MediaLabel
FindSD
Get_Artist
Get_Album
Get_Media
RenameByMask
ParseText
CalculateGapData
CalculateGapDataExt
Get/Set_isBookmarkable
Get/Set_canCrossfade
Get/Set_isShuffleIgnored
Get/Set_TempString
MarkPlayed
DiscardChanges
Additional InformationHelpdesk Ticket # 2159
TagsNo tags attached.
Fixed in build2624

Relationships

related to 0017174 closedpetr Issues with SDBApplication.Player getters and methods [COM] 
related to 0017897 closedLudek Adding a reference to MediaMonkey5 Library in Visual Studio crashes Visual Studio 
related to 0018999 assigneddrakinite API is unorganized, poorly documented, with many things missing or wrong 

Activities

Ludek

2022-04-07 19:22

developer   ~0067489

As dicussed with MonkeyMote dev via [Ticket # 2159] we will implement the necessary stuff for the MonkeyMote app to work, full port of so deprecated "COM api" not planned atm

Ludek

2022-04-07 20:04

developer   ~0067490

Last edited: 2022-04-07 20:14

Fixed in 2614

His testing plugin now correctly adds testing track into Playing queue.

Ludek

2022-04-25 08:59

developer   ~0067751

Re-opened, further feedback from the mmote dev (ticket # 2159):

SDBPlayer::isShuffle can be set to true, but not to false
SDBPlayer::isRepeat can be set to true, but not to false, only supports 'repeat all'
SDBPlayer::CurrentPlaylist and CurrentSongList return empty lists
SDBSonglist::Item crashes (maybe not implemented?)

Ludek

2022-04-26 20:12

developer   ~0067805

Last edited: 2022-04-26 20:17

Hi, I've been looking into it today, compiled testing app in Visual Studio 2022 and the progress so far is:

SDBPlayer::isShuffle can be set to true, but not to false
=> fixed

SDBPlayer::isRepeat can be set to true, but not to false, only supports 'repeat all'
=> I have changed the property from bool to string, it can be now set as string values 'off', 'all', 'one'

Or alternatively you can use this:
m_app->runJSCode('app.player.repeatPlaylist = true; app.player.repeatOne = true;', false);
i.e. execute it as native JS code (like in actions.js)

SDBPlayer::CurrentPlaylist and CurrentSongList return empty lists
=> I've fixed this, but then I realized that it works only for shorter lists (with several files in Playing).
For long lists with thousands of tracks it fails, because Petr implemented the messaging between browser process (MediaMonkey.exe) and render process (MediaMonkeyEngine.exe) as serialized JSON -- which fails for very long string messages.
I will need to rewrite it all to shared memory (which will take me some time) -- this will improve performance and also resolves the issues with long lists.

Ludek

2022-05-03 18:27

developer   ~0067948

I've made some changes and fixes and asked the mmote dev to test it.

Nevertheless I suppose he will face further issues with the incomplete COM api during implementation of his MonkeyMote plugin.
So moving target to 5.0.4

Ludek

2022-05-06 20:37

developer   ~0068034

Last edited: 2022-05-09 12:17

Some tips for workarounding with SDB.runJSCode : https://www.mediamonkey.com/wiki/Controlling_MM5_from_External_Applications

Fixed crash when adding MM5 COM reference in Visual Studio as 0017897

No longer supported interfaces/methods like SDBTree removed

peke

2022-05-13 21:02

developer   ~0068141

Verified 2625

Tested with adding MM5 COM reference in Visual Studio and Primal Script 2022.

peke

2022-05-13 21:02

developer   ~0068142

left resolved for further cleanup in 5.0.4 as needed.

peke

2022-08-30 23:53

developer   ~0069100

Verified and reviewed in 2661

Closed no more cleanup is needed for now.