ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

IDEA: Need an .MPCPL file editor

(1/6) > >>

fdwojo:
The media player I prefer to use is Media Player Classic, and like many (probably all) players, you can save playlists (.mpcpl files). Also, when in MPC, you can edit the playlist by dragging one file at a time up and down the list and dropping it where you wish. However, if you have more the 1 or 2, it can be a very tedious task, especially if you have a long list. And if you're me, you have VERY long lists of songs and videos to play through.  8)

Is there, or has anyone ever considered creating, an editor for these MPCPL files? Although the file is a simple text file, the trick is that each item in the list takes up 2 (or more) lines. Plus, each item (in order) has to be numbered, from 1 on up before saving it. Lastly, each line in a set of lines for a media item has to all have the same number. And that's the problem. If I were to try to edit it in notepad, even if I moved only one media file entry, I'd need to re-number the entire list (which is a PitA).

So, can anyone create a program that will allow the editing of the file and move the 2 (or more) lines for each media item as a group, and renumber the entire thing when done and save it back?

For what it's worth, (in case you're not familiar with the playlist format, here is a example of an MPCPL file with 6 media items in it:


--- ---MPCPLAYLIST

1,type,0
1,filename,C:\Users\fdwojo\Music\themesong.mp3

2,type,0
2,label,Extended Themesong #2
2,filename,C:\Users\fdwojo\Music\ts2_h264.mp3

3,type,0
3,label,Robot (1080p)
3,filename,C:\Users\fdwojo\Videos\Robot.avi

4,type,0
4,filename,C:\Users\fdwojo\Videos\Mass Effect Playthrough.mp4

5,type,0
5,filename,C:\Users\fdwojo\Videos\Far Cry Playthrough.mp4

6,type,0
6,filename,D:\Movies\Action Adventure\Indiana Jones #9.mp4
6,subtitle,D:\Movies\Action Adventure\Indiana Jones #9.srt

I've taken the liberty of adding blank lines between each media item to make it easier to see what constitutes each media item. However, the normal file would not have ANY blank lines.

Requirements (Ideally):
   Works in Windows
   Be able to cut/paste from one place in the list to another.
   Have up/down arrow buttons to move item(s) up/down the list.
   When saving at the end, it will renumber all items from 1 on up.
   Because it needs to contain full path names, it should support Unicode.

Recommendation:
   Either show 1 line for each media item, otherwise
   Show all lines for each media item,
   but when moving (or Cut/Paste), all items of a media item move with it.

Thanks to anyone who can help.

fdwojo

wraith808:
Label is pretty self explanatory, as is filename.

What about type?  All of them are different filetypes, so I guess it's not that.  But one would have to know what it corresponds to, unless they were just going to put that line in verbatim.

fdwojo:
Although I don't have any specifics from the people who wrote MPC, TYPE has always been a zero (0) in all the MPCPL files I've ever created.
Also, FILENAME is used in all of them as well.
I have a few files that have the LABEL line, but those only appear if the user renamed the file in the playlist while in the program (MPC). For the uses I do, it's not critical unless a filename is rather vague about what it is and I want to clarify it.
The SUBTITLE line I've only noticed a few times, but that one is pretty much required.

Now please keep in mind that knowing WHAT lines to use isn't the problem here. Rather, it's that I have a few rather long playlists for MPC and if it's just one entry, I can easily drag it up or down in the list. But many times, I have numerous lines that I want to move elsewhere in that playlist. And since (A) you can only move one line at a time, and (B) if you try to edit the MPCPL file in a text editor, you have to renumber all the lines so that it all works out in order.

So, in short, knowing what lines to create isn't needed. What *IS* needed is a simple way to move entries in the list around and have it bring any other matching lines with it and then renumber all the lines.

For instance, lets say I wanted to reorganize the list so that it was all MP4's first, then AVI second, and then MP3's last. It would come out like this (if I only copy and paste lines):


--- ---MPCPLAYLIST

4,type,0
4,filename,C:\Users\fdwojo\Videos\Mass Effect Playthrough.mp4

5,type,0
5,filename,C:\Users\fdwojo\Videos\Far Cry Playthrough.mp4

6,type,0
6,filename,D:\Movies\Action Adventure\Indiana Jones #9.mp4
6,subtitle,D:\Movies\Action Adventure\Indiana Jones #9.srt

3,type,0
3,label,Robot (1080p)
3,filename,C:\Users\fdwojo\Videos\Robot.avi

1,type,0
1,filename,C:\Users\fdwojo\Music\themesong.mp3

2,type,0
2,label,Extended Themesong #2
2,filename,C:\Users\fdwojo\Music\ts2_h264.mp3

Now, if I did this and tried to play this playlist in MPC, it would actually play in order from #1 to #6. But I had wanted it in a different order, so I'd have had to renumber all the lines so that the first media item was 1, the second was 2, and so on. That's the functionality I'm looking for. It will rearrange the lines, and RENUMBER them into the order I indicate.

Now, in case you're wondering, if you look at the playlist while you are in MPC, it would look like this:


--- ---1. themesong.mp3
2. Extended Themesong #2
3. Robot [1080p]
4. Mass Effect Playthrough.mp4
5. Far Cry Playthrough.mp4
6. Indiana Jones #9.mp4
Now, imagine this list a lot longer, like maybe a hundred songs and videos. Trying to edit that is tremendously difficult. It all comes down to the fact that each media item in the play list will consist of 2-4 (or more?) lines that make up that one media item. I would need them kept as a group, and moved as a group to whatever new location in the list I'd specifiy.

I hope my description of the problem has helped.

fdwojo

wraith808:
Now please keep in mind that knowing WHAT lines to use isn't the problem here. Rather, it's that I have a few rather long playlists for MPC and if it's just one entry, I can easily drag it up or down in the list. But many times, I have numerous lines that I want to move elsewhere in that playlist. And since (A) you can only move one line at a time, and (B) if you try to edit the MPCPL file in a text editor, you have to renumber all the lines so that it all works out in order.
-fdwojo (March 30, 2018, 05:45 PM)
--- End quote ---

Knowing the universe of lines is necessary to group them together.  The other was just in case someone wanted to add in the ability to actually edit them in the program, which seems like it could be  useful.

Not sure if I'll have time to get to it, especially before skwire jumps in.  But it's interesting enough that I might try to make time for it soon.

Oh, and in my search for MPCPL files, I found this bit of code from https://autohotkey.com/board/topic/16904-create-media-player-classic-playlist-for-videos-in-folder/

Not sure if you might find it useful.  It does seem to bear out the theory on type, as I could find no other references.


--- Code: Autohotkey ---`::  ; writes a Media Player Classic Playlist file for all video files in chosen directory.  Accent key launches the script. SetBatchLines, -1  ; Make the operation run at maximum speed. ;FileSelectFolder, WhichFolder,::{20d04fe0-3aea-1069-a2d8-08002b30309d}  ; Ask the user to pick a folder, My Computer option FileSelectFolder, WhichFolder,%A_MyDocuments%  ; Ask the user to pick a folder, My Documents option if (StrLen(WhichFolder) = 0)        return ; No folder picked, so stop SetWorkingDir, %WhichFolder% FileAppend,(        MPCPLAYLIST ; next blank line is crucial, don't delete ), play.mpcpl ; this is the name of the playlist file count=1 If ErrorLevel <> 1{        Loop, %WhichFolder%\*.mov, , 1 ; Quicktime        {                 FileAppend,                (                        %count%,type,0                        %count%,filename,%A_LoopFileFullPath%                 ), play.mpcpl                 count := count + 1               } }Else        Exit If ErrorLevel <> 1{        Loop, %WhichFolder%\*.mpg, , 1 ; MPG        {                 FileAppend,                (                        %count%,type,0                        %count%,filename,%A_LoopFileFullPath%                 ), play.mpcpl                 count := count + 1               } }ElseExit If ErrorLevel <> 1{        Loop, %WhichFolder%\*.avi, , 1 ; AVI        {                 FileAppend,                (                        %count%,type,0                        %count%,filename,%A_LoopFileFullPath%                 ), play.mpcpl                 count := count + 1               } }Else        Exit If ErrorLevel <> 1{        Loop, %WhichFolder%\*.wmv, , 1 ; Windows Media        {                 FileAppend,                (                        %count%,type,0                        %count%,filename,%A_LoopFileFullPath%                 ), play.mpcpl                 count := count + 1               } }Else        Exit If ErrorLevel <> 1{        Loop, %WhichFolder%\*.mpeg, , 1 ; MPEG        {                 FileAppend,                (                        %count%,type,0                        %count%,filename,%A_LoopFileFullPath%                 ), play.mpcpl                 count := count + 1               } }Else        Exit return

skwire:
Not sure if I'll have time to get to it, especially before skwire jumps in.  But it's interesting enough that I might try to make time for it soon.-wraith808 (March 30, 2018, 09:05 PM)
--- End quote ---

I can start work on this, but please don't let that stop you from writing your own version.

Navigation

[0] Message Index

[#] Next page

Go to full version