Page 1 of 3

Available COM interface

Posted: Sun Feb 12, 2017 6:11 am
by PetrCBR
These COM commands/events will be implemented in MM5 next build (2061) :
  • SDBApplication Events
    NotifyFinish, CallDeviceFileCopiedEvent, CallDeviceSyncCompletedEvent, CallDeviceSyncStartedEvent, CallDownloadFinishedEvent, CallPartyModeEnabledEvent, DoAppIdle, DoBeforeTracksMove, DoFilterChange, DoNowPlayingModified, DoNowPlayingSelectionChanged, DoOptionsChange, DoPlaybackCompleteEnd, DoPlaybackEnd, DoPlaybackSeeked, DoPlaylistAdded, DoPlaylistChanged, DoPlaylistRemoved, DoRepeatClicked, DoSelectionChanged, DoShuffleClicked, DoTrackAdded, DoTrackConverted, DoTrackDeleting, DoTrackDoubleClick, DoTrackEnd, DoTrackListFilled, DoTrackListFilling, DoTrackListModified, DoTrackListSelectionChanged, DoTrackPlaybackPaused, DoTrackPlaybackStarted, DoTrackPlaybackStopped, DoTrackPropertiesEvent
    SDBApplication
    VersionString, VersionHigh, VersionLo, VersionRelease, Localize, LocalizeGen, toASCII, IsRunning, ApplicationPath, MyMusicPath, EqualizerPath, IconsPath, PluginsPath, ScriptsPath, SkinsPath, Format, LocalizedFormat, runJSCode, fromJSON (since 2089)
    SDBApplication.Player
    CurrentPlaylist, CurrentSong, CurrentSongIndex, Panning, Volume, PlaylistClear, Next, Pause, Previous, Stop, isPlaying, isPaused, CurrentSongLength, PlaybackTime, isAutoDJ, isRepeat, isShuffle, isCrossfade, isStartingPlayback, PlaylistSelected, PlaylistFocused, StopAfterCurrent
    SDBApplication.Database
    ExecSQL, OpenSQL (returns result as JSON string), BeginTransaction (since 2066), Commit (since 2066), ForceCommit (since 2066)

Re: Available COM interface

Posted: Sun Feb 26, 2017 3:14 pm
by TIV73
I just installed build 2061 and tried to import the mediamonkey com object in visual studio, but could only find a reference to the object of version 4. I suppose this makes sense as it's only a portable installation, so the needed assemblies probably aren't registered. Do you know if there is any way to get the needed reference or some way to manually register the new MM5 interface in order to be able to use it in .net applications?

Besides, since MM5 seems to focus on cross-platform compatibility - is com the recommended interface for external applications/scripts or should we be using something else entirely?

Re: Available COM interface

Posted: Mon Mar 06, 2017 2:14 am
by PetrCBR
You can register using REGCOMSERVER command line parameter. JavaScript/HTML scripting is highly recommended.

Re: Available COM interface

Posted: Wed May 31, 2017 11:41 pm
by Barry4679
PetrCBR wrote:These COM commands/events will be implemented in MM5 next build (2061) :
  • ...
    SDBApplication.Database
    ExecSQL, OpenSQL (returns result as JSON string)
Are you also going to do BeginTransaction and Commit?

Re: Available COM interface

Posted: Thu Jun 01, 2017 1:46 am
by PetrCBR
Will implement them.

Re: Available COM interface

Posted: Thu Jul 27, 2017 7:01 am
by pgrimmer
I am very confused. I recently decided to write some scripts (actually using COM within Visual Basic 6 and VBA inside of Excel) and I see that MM5 is not going to use COM any more. I think that's not a smart move but that's not the basis of this post.

IN the first post of this thread it says "These COM commands/events will be implemented in MM5 next build (2061)".

My confusion is that this is in the MM5 developer forum but it is talking about new COM commands and events but the other posts I read say that COM is not part of MM5. So is COM/ActiveX part of MM5 or not? Thanks.

Re: Available COM interface

Posted: Thu Jul 27, 2017 8:21 am
by PetrCBR
MM5 is moved to chromium so main scripting language is JavaScript. Some basic MM4 COM API is implemented, but we do not plan to implement complete COM API.

Re: Available COM interface

Posted: Thu Jul 27, 2017 8:42 am
by pgrimmer
Thanks. Is there somewhere I can go to find out what COM is planned to be included and what is going to be excluded (at least v4 things that won't be available in v5)? Thanks.

Re: Available COM interface

Posted: Thu Jul 27, 2017 8:57 am
by PetrCBR
No we do not have such a list.

Re: Available COM interface

Posted: Tue Dec 05, 2017 1:03 am
by Barry4679
Could you please consider a COM call to return the current result contents of a specified MM auto-playlist?

Either something where I passed the IDPlaylist or PlayListName of an autoplaylist, and a target playlist name, and the call exported a static playlist into PlaylistSongs,

Or return a rowset with the current content of the passed autoplaylist, with columns as per PlaylistSongs.

?

Re: Available COM interface

Posted: Fri Dec 08, 2017 9:12 am
by Ludek
Hi, why do you need this?

You can just get the tracklist of the auto-playlist to get the content, isn't it?

Re: Available COM interface

Posted: Fri Dec 08, 2017 9:52 pm
by Barry4679
Ludek wrote:Hi, why do you need this?

You can just get the tracklist of the auto-playlist to get the content, isn't it?
How?

I know how do it via the UI, but how do I do it via an application attached to your db via COM?

ie. The track list is|was a member in SDBPlayList, and you haven't said that you will implement that.

The definition of an autoplaylist is in the QueryData column of the Playlist table, but it is in a propriety format. It is not very robust to reverse engineer this.

I was hoping for a COM call which would populate a target static playlist from the autoplaylist definition, ie populate the current playlist entries into a target static playlist in the Playlist & PlayListSongs tables.

Or have something which triggered output like ExecSQL; ie. I passed it the ID of a autoplaylist, then you generated the sql from your priopriety QueryData definition, ran the query, then passed back the track rows in something like PlayListSongs format.

Or pass back the sql statements, so I could run the query myself

Re: Available COM interface

Posted: Sun Dec 10, 2017 5:55 am
by Ludek
OK,
at first I don't know your reasons why you are not using the native MM5 scripting engine and its method getTracklist ( http://www.mediamonkey.com/webhelp/MM5P ... tTracklist )

Anyhow looking into our code you seem to be right that SDBPlayList is not fully implemented, most of the code of the corresponding properties/methods is commented out.
Seems to make sense to add them, going to discuss with other devs and look into it.

Just keep in mind that COM interface in MM5 will never be so powerful and so maintained as the native scripting interface (and won't be cross platform)

Re: Available COM interface

Posted: Sun Dec 10, 2017 5:15 pm
by Barry4679
Ludek wrote:Just keep in mind that COM interface in MM5 will never be so powerful and so maintained as the native scripting interface (and won't be cross platform)
Just trying keep something running on MM5, something which already exists.

Thanks for considering this.

Re: Available COM interface

Posted: Sun Dec 10, 2017 6:28 pm
by Barry4679
The new documentation looks sweet.

I haven't yet figured out how it relates to the COM facilities.

You would need to also make sure that the PlaylistByID method was implemented
http://www.mediamonkey.com/wiki/index.p ... aylistByID

These would be good also

SDBApplication.PlaylistByTitle
SDBApplication.Database.Path
SDBApplication.IniFile.Path

http://www.mediamonkey.com/wiki/index.p ... istByTitle
http://www.mediamonkey.com/wiki/index.p ... base::Path
http://www.mediamonkey.com/wiki/index.p ... File::Path

SDBApplication.VersionHigh is on your list but should be VersionHi.
VersionRelease is also on the list, but returns a blank. ? because MM5 not released?