topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 7:22 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: IDEA: Need an .MPCPL file editor  (Read 21601 times)

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
IDEA: Need an .MPCPL file editor
« on: March 30, 2018, 04:15 PM »
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
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #1 on: March 30, 2018, 05:03 PM »
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #2 on: March 30, 2018, 05:45 PM »
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
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:
« Last Edit: March 30, 2018, 07:34 PM by fdwojo »

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #3 on: March 30, 2018, 09:05 PM »
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.

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.c...or-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 [Select]
  1. `::  ; writes a Media Player Classic Playlist file for all video files in chosen directory.  Accent key launches the script.
  2.  
  3. SetBatchLines, -1  ; Make the operation run at maximum speed.
  4.  
  5. ;FileSelectFolder, WhichFolder,::{20d04fe0-3aea-1069-a2d8-08002b30309d}  ; Ask the user to pick a folder, My Computer option
  6.  
  7. FileSelectFolder, WhichFolder,%A_MyDocuments%  ; Ask the user to pick a folder, My Documents option
  8.  
  9. if (StrLen(WhichFolder) = 0)
  10.         return ; No folder picked, so stop
  11.  
  12. SetWorkingDir, %WhichFolder%
  13.  
  14. (
  15.         MPCPLAYLIST ; next blank line is crucial, don't delete
  16.  
  17. ), play.mpcpl ; this is the name of the playlist file
  18.  
  19. count=1
  20.  
  21. If ErrorLevel <> 1
  22. {
  23.         Loop, %WhichFolder%\*.mov, , 1 ; Quicktime
  24.         {
  25.  
  26.                 FileAppend,
  27.                 (
  28.                         %count%,type,0
  29.                         %count%,filename,%A_LoopFileFullPath%
  30.  
  31.                 ), play.mpcpl
  32.  
  33.                 count := count + 1     
  34.  
  35.         }
  36.  
  37. }
  38. Else
  39.         Exit
  40.  
  41. If ErrorLevel <> 1
  42. {
  43.         Loop, %WhichFolder%\*.mpg, , 1 ; MPG
  44.         {
  45.  
  46.                 FileAppend,
  47.                 (
  48.                         %count%,type,0
  49.                         %count%,filename,%A_LoopFileFullPath%
  50.  
  51.                 ), play.mpcpl
  52.  
  53.                 count := count + 1     
  54.  
  55.         }
  56.  
  57. }
  58. Else
  59.  
  60. If ErrorLevel <> 1
  61. {
  62.         Loop, %WhichFolder%\*.avi, , 1 ; AVI
  63.         {
  64.  
  65.                 FileAppend,
  66.                 (
  67.                         %count%,type,0
  68.                         %count%,filename,%A_LoopFileFullPath%
  69.  
  70.                 ), play.mpcpl
  71.  
  72.                 count := count + 1     
  73.  
  74.         }
  75.  
  76. }
  77. Else
  78.         Exit
  79.  
  80. If ErrorLevel <> 1
  81. {
  82.         Loop, %WhichFolder%\*.wmv, , 1 ; Windows Media
  83.         {
  84.  
  85.                 FileAppend,
  86.                 (
  87.                         %count%,type,0
  88.                         %count%,filename,%A_LoopFileFullPath%
  89.  
  90.                 ), play.mpcpl
  91.  
  92.                 count := count + 1     
  93.  
  94.         }
  95.  
  96. }
  97. Else
  98.         Exit
  99.  
  100. If ErrorLevel <> 1
  101. {
  102.         Loop, %WhichFolder%\*.mpeg, , 1 ; MPEG
  103.         {
  104.  
  105.                 FileAppend,
  106.                 (
  107.                         %count%,type,0
  108.                         %count%,filename,%A_LoopFileFullPath%
  109.  
  110.                 ), play.mpcpl
  111.  
  112.                 count := count + 1     
  113.  
  114.         }
  115.  
  116. }
  117. Else
  118.         Exit
  119.  
  120. return
« Last Edit: March 30, 2018, 09:11 PM by wraith808 »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #4 on: March 30, 2018, 09:09 PM »
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.

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

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #5 on: March 30, 2018, 10:36 PM »
I must admit that I haven't ever gotten around to trying and using AutoHotkey for any tasks. I knew it was available, but for the most part, I hadn't ever tried it for anything. Admittedly, I don't know enough about AHK because I would have thought that it would just run programs, not that it could "create" a program. Yes, I know that AHK uses scripts, but I was always under the impression that it just triggered existing programs. I'll have to look into it to see if it's worthwhile.

However, being able to avoid AHK and instead using a standalone program that either of you have the chance for, would actually be the preferable solution for what I'm looking for. I guess we all have things to look into.

By the way, I was looking over the script that you listed there to see if I could get an idea from what it was doing. Granted, I don't have any RL experience with AHK, but it looks like your idea is to create a brand new playlist from, say, a folder full of media, maybe even from a folder and it's subfolders. Unfortunately, that wasn't what I was hoping for. Rather, I was looking for the ability to edit existing playlists into the order I wish, and possibly add or remove some entries (Media item) in the list. I greatly apologize if I didn't make that clear.

Anyways, I'll check out your script to see what it does to see if I guess right from what I could read of it.

I'll check back. Thank you both for your responses!

fdwojo
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #6 on: March 30, 2018, 11:20 PM »
It's not my script.  It's just one that I found in my research that I thought might be of use.  What it does is in the comments at the top, i.e. writes a Media Player Classic Playlist file for all video files in chosen directory.  Accent key launches the script.

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #7 on: March 31, 2018, 01:01 AM »
That's okay, I realize it wasn't your script when you provided the link to where it came from. I was only referring to the fact that it really isn't what I'm trying to accomplish. Hopefully there is a solution out there.

fdwojo
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #8 on: March 31, 2018, 10:19 PM »
Just as a matter of interest, what's wrong with a normal M3U file?

MPC, (Black Edition in my case), can save/read that format.

eg.
Code: Text [Select]
  1. #EXTM3U
  2. Z:\Misc Music & Videos\Andain_-Turn_Up_The_Sound_Chillout_Mix_.mp3
  3. Z:\Misc Music & Videos\Ascension - For A Lifetime (Chillout Mix).mp4
  4. Z:\Misc Music & Videos\Aurosonic _ Frainbreeze and Katty Heath - All I Need (Progressive Mix).mp4
  5. Z:\Misc Music & Videos\Black Jonas Point - Lo Que Quieras.ogg
  6. Z:\Misc Music & Videos\Café del Mar (Rastafari Lounge).mp3
  7. Z:\Misc Music & Videos\Jah Khalib - Лейла   Official video.mp4

A lot easier to edit being just a single line.

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #9 on: March 31, 2018, 10:51 PM »
Unfortunately, that's not really the problem I'm having. As I said in my original post, I can create MPCPL files just fine. And of course, if I double-click on a .MPCPL file it does indeed open up in MPC. The task I'm trying to find a solution for is to be able to easily edit a VERY LONG (over 100 media items) list. If you have ever opened a long playlist in MPC that is too long for the height of your screen, try to move an item from the top of the list to the bottom (or vice versa). It's a real pain in the a**. And if you want to move a chunk of them (like say, 10 media items), you have to do them each one at a time.

Now, as I also mentioned, I can open that same MPCPL file in notepad (for instance). The difficulty here is that If I cut and paste a group of lines from one area to another in the same list, and don't renumber all the lines to go from 1 for the first media item lines on up to the highest number for the last media item, then that MPCPL file will play back in the original order that it was in before you changed it because of the numbers in front of each line telling MPC in what order to play them in. In fact, if you open up the changed MPCPL file, you'll see all the same media in the list in the same order it was in before you edited it.

I was kind of hoping that since all I'm looking for is some kind of custom text editor that will take into account all the lines for each media item and keep them together, and also renumber them based on 1 at the beginning, and going up until it gets to the end.

If you are curious, and if you haven't done it yet, pick out an MPCPL file of yours that has a lot of media items in it and open it in Notepad or whatever text editor you like. You'll see that each media item is NOT just one line. Each media item will be at LEAST two lines. a TYPE line, and a FILENAME line. Plus a SUBTITLE line if there is a subtitle track for the video item, plus a LABEL line in case the user (you,, for example) had renamed the item while in the playlist of MPC. By the way, when you try to drag an item either up or down the list where it would need to scroll, it is a rather slow scroll, which explains part of the problem with trying to rearrange items in the list.

And before you suspect that I have an old computer, I don't. Mine has 64GB RAM, 4 GHz Quad core CPU, with an SSD system drive. And no, there's not much other stuff running on the PC.

Now, as an additional idea, the only two critical lines are the TYPE and FILENAME lines. The LABEL and SUBTITLE lines could actually be lost and it wouldn't really be that much of a problem. Although, considering the media items as a group will all have the same number in front of them, I'd really like to keep them if they exist. As long as a TYPE line comes right before the FILENAME line, and both of them (in each pair) has the same, but unique number from other media items.

Oh, and with regard to the M3U files, if you try to save a playlist in MPC, it will save in the M3U format, but if any of the Media files in the list referenced a Subtitle file, I'll have lost track of that in the M3U and PLS formats. Plus, if I wanted to relabel a media file in the playlist to be more informative, that option is not saved, either.

I hope that gets my desire across better than what I guess I had originally posted.

Does anyone have any ideas for an editor like this?

fdwojo
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:
« Last Edit: March 31, 2018, 10:58 PM by fdwojo »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #10 on: March 31, 2018, 11:27 PM »
Oh, and with regard to the M3U files, if you try to save a playlist in MPC, it will save in the M3U format, but if any of the Media files in the list had Subtitle files, I'll have lost track of them in the M3U and PLS formats.

Not really a problem as I see it, the subtitle file will have the same name as the media file, thus it will be listed next to it on the directory and MPC will auto-load it if it's the same name so a separate entry in a playlist isn't necessary.

Only time I can see the subtitle file having a different name is if you have multiple subtitle streams for the one media file. But I still don't consider that a problem since I mux all subtitle files into MP4/MKV containers and just select which I want from the subtitle menu, the less unnecessary files in a directory the better.

And also, if I wanted to relabel a media file in the playlist to be more informative, that option is out, too.

I guess but since my media files are named informatively to start with or are grouped within directories due to relevance, that's not a problem I've run into.

BTW, that's also supported under M3U via the #EXTINF: line.

MPC will also use metadata, (ID3), info if available, all my audio files have it, (MP3, OGG, M4A, FLAC, etc) and also can be added to MP4, MKV, OGV, etc video ... it also means that it travels with the media file rather than relying on a text file.

If you are curious, and if you haven't done it yet, pick out an MPCPL file of yours that has a lot of media items in it and open it in Notepad or whatever text editor you like.

I don't use MPCPL, I use M3U because they're universally supported across all my devices: tablets, phones, media players, computers.

I only asked what was wrong with using an M3U playlist as an alternative.
« Last Edit: April 01, 2018, 12:53 AM by 4wd »

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #11 on: April 01, 2018, 07:17 AM »
So is this #EXTINF line a separate line from the actual Media file line?

And as for my using MPCPL as opposed to M3U, I just never had used any programs that had M3U as a default format. In fact (if you'll excuse my ignorance), until you mentioned it, I didn't even know that MPC supported it. As for the Subtitle files, they don't always match the filename. But then, with MPC, it first looks in the media file folder to see if there's a valid Subtitle file there, and if not, it looks for one in a SUBS folder, and if it's there, it uses that, no matter what the name. I guess I'll have to go thru all my subtitle files and have a bit of renaming to do!   :P

Thanks very much for that idea of using M3U, tho. For that reason, I will consider this topic to be DONE and closed.

fdwojo

P.S. I don't know if it's supposed to be me that changes the Topic title to
        "DONE: Need an .MPCPL file editor"
or if someone else does that. If it's me, could someone tell me where/how it's done? I didn't see any kind of link anywhere that would allow me, the original poster, to change it. Sorry if I'm stupid and missing something obvious.
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #12 on: April 01, 2018, 07:52 AM »
So is this #EXTINF line a separate line from the actual Media file line?

Yes

Code: Text [Select]
  1. #EXTM3U
  2. #EXTINF:285,A song
  3. Z:\Misc Music & Videos\Andain - You Once Told Me (Unofficial video).mp3
  4. #EXTINF:220,A video
  5. Z:\Misc Music & Videos\Black Jonas Point - Lo Que Quieras.mp4

Description

Much better though is to use the files metadata then the #EXTINF line isn't required making the M3U just a list of files which is a lot easier to handle.

As for the Subtitle files, they don't always match the filename. But then, with MPC, it first looks in the media file folder to see if there's a valid Subtitle file there, and if not, it looks for one in a SUBS folder, and if it's there, it uses that, no matter what the name. I guess I'll have to go thru all my subtitle files and have a bit of renaming to do!   :P

You can mux the srt into a MP4 video container with a simple ffmpeg command:

Code: Text [Select]
  1. ffmpeg -i example.avi -i example.srt -c copy -c:s mov_text example.mp4

Or if you prefer Matroska files you can use MKVToolnix.

Personally prefer MP4 as it's more widely accepted by devices plus any metadata can be added via the normal Windows Properties dialog or any other metadata editor.

2018-04-01 22_54_05-Ascension - For A Lifetime (Chillout Mix).mp4 Properties.png

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #13 on: April 01, 2018, 09:20 AM »
So is this #EXTINF line a separate line from the actual Media file line?

And as for my using MPCPL as opposed to M3U, I just never had used any programs that had M3U as a default format. In fact (if you'll excuse my ignorance), until you mentioned it, I didn't even know that MPC supported it. As for the Subtitle files, they don't always match the filename. But then, with MPC, it first looks in the media file folder to see if there's a valid Subtitle file there, and if not, it looks for one in a SUBS folder, and if it's there, it uses that, no matter what the name. I guess I'll have to go thru all my subtitle files and have a bit of renaming to do!   :P

Thanks very much for that idea of using M3U, tho. For that reason, I will consider this topic to be DONE and closed.

fdwojo

P.S. I don't know if it's supposed to be me that changes the Topic title to
        "DONE: Need an .MPCPL file editor"
or if someone else does that. If it's me, could someone tell me where/how it's done? I didn't see any kind of link anywhere that would allow me, the original poster, to change it. Sorry if I'm stupid and missing something obvious.

No, someone else does it.  So you don't need the editor?  I was paused in any case, as 4wd seemed to be trying to show you an implementation that would work out of the box, and his questions seemed to make sense to me.  Just wanted to verify.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #14 on: April 01, 2018, 09:22 AM »
Does anyone have any ideas for an editor like this?

I'm working on it and should have a basic version ready to go later today.

P.S. I don't know if it's supposed to be me that changes the Topic title to
        "DONE: Need an .MPCPL file editor"
or if someone else does that.

I take care of that.  Did you want me to change it and call it a day or did you want me to continue working on the application I mentioned above?

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #15 on: April 01, 2018, 07:49 PM »
... did you want me to continue working on the application I mentioned above?

My vote is if you're happy to continue, go for it ... one more tool in the toolbox and all that  ;)
Maybe even an export as a Extended M3U with #EXTINF for those files with Label in the MPCPL file, (would necessitate determining the file duration in seconds though which might slow things down).

Only wanted to suggest an alternative methodology that I think would be simpler/easier to maintain in the long run.

FWIW, there is a playlist editor on SourceForge, (in Java), but I couldn't get it to run.
« Last Edit: April 01, 2018, 07:54 PM by 4wd »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #16 on: April 01, 2018, 09:54 PM »
My vote is if you're happy to continue, go for it ... one more tool in the toolbox and all that

I've been working on it on and off today; it's just about done.  Here's a teaser screenshot:

2018-04-01_200031.pngIDEA: Need an .MPCPL file editor

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #17 on: April 01, 2018, 10:23 PM »
Given the rather formalised format of the MPCPL file, would it not be possible to import it into Excel, (or some other spreadsheet program), to work on it there?

Just wondering since it's kind of a multi-line CSV format, might even be easy to write a small converter program/script, (seems like it should be easy in PowerShell) to convert the MPCPL to a standard CSV and vice versa when finished manipulating it within the spreadsheet.

Would allow you to use all the pattern matching, multi-column sorting, Find/Replace, etc functions already available.
« Last Edit: April 01, 2018, 10:30 PM by 4wd, Reason: GFU »

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #18 on: April 02, 2018, 09:47 AM »
My vote is if you're happy to continue, go for it ... one more tool in the toolbox and all that

I've been working on it on and off today; it's just about done.  Here's a teaser screenshot:

[ Invalid Attachment ]


Heh. I guess what you said about having different implementations was true.  Mine didn't have the nifty up/down arrows in the right click menu, but used something similar to the steam wishlist, where you put in the position where you wanted it, and it renumbered each record.  I might still finish it as it's an interesting problem- but I already did the part that I wanted to do, i.e. parse a text file that didn't have a set format and put it into an object.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #19 on: April 02, 2018, 04:52 PM »
Here's the initial release of MPCPLed:

http://www.dcmembers.../mpcpled/MPCPLed.zip

@fwdojo:  Please try this on copies of your playlists just in case you come across any bugs within my app.  Also, the app handles type, file, label, and subtitle lines.  I couldn't find a specification on the MPCPL format so, if you come across others, please let me know and I'll add support for them.

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #20 on: April 03, 2018, 07:18 AM »
Sorry folks, for the lapse for those few days. It was a bit of a busy Easter and Dyngus Day. But I found 4WD's info and links very helpful. And I thank all of you for the great info you've provided. It's given me a few good ideas. However, besides that, I must also thank skwire for working up the MPCPLed tool. I'll be trying that out over the next day or two to see if there are any unforeseen bugs in it. I doubt it, but I'll check for everyone who might like to use it's sake.

But I really have to say that you guys really rock! I very much appreciate all the time and thought you all put in to helping me (and hopefully others), and I'll be looking around for other ideas from all of you.

Thanks!

fdwojo
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #21 on: April 03, 2018, 07:52 AM »
Okay, so this reply is mostly for skwire. At your request, the first thing I did was to copy over my MPCPL folder onto the desktop. Then I unzipped your files onto the desktop. Once that was done, I ran your EXE to just see what things looked like before I started any editing.

Unfortunately, at first, my AV software kept wanting to check it out because it was a "rare, new file" that might be a virus. But I told it I trusted it and it stopped bothering me. Then, when I ran it again, it immediately popped up this error message window:

[ Invalid Attachment ]

Also, I tried to drag and drop an MPCPL file onto the EXE file just to see what it would do, but it gave the exact same error.

If it helps any, my system is:

  • Windows 10 Pro 64-bit, fully up-to-date on any available patches
  • 64GB RAM
  • 4GHz Quad-Core CPU

If there is anything else you need to know, just drop a line or a reply.

Good luck!

fdwojo
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:
« Last Edit: April 03, 2018, 08:05 AM by fdwojo »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #22 on: April 03, 2018, 10:10 AM »
Well, that's embarassing.   :-[  Apologies.  Please redownload the zip file and try now.

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #23 on: April 03, 2018, 03:17 PM »
Okay, so let me give you the short version of the results. It works great! I'll admit it threw me for a moment when I loaded up an MPCPL file that used LABEL and SUBTITLE because each "line" is in a separate column. But admittedly, that probably makes it even easier to code. If the column is blank, you don't need to "write" that line to the final file. Very elegant.

Now, being the kind of person that I am, I'd like to request one more feature. Is it possible to either allow creating new lines? Or better still, allow dragging and dropping media files into the window so that they simply get added in as lines (probably at the bottom of the list)? True, you'd (by default) only fill in TYPE and FILENAME, but that's okay. If I need to I could add the LABEL when necessary and/or add a SUBTITLE file if needed. Aside from that, it really works great!

On a weird side note, I tried dragging a media file into the editor, and it DID give me the cursor with a (+) symbol beneath the arrow just like if I was dragging a file from one folder to another. But when I let go of the mouse button, nothing happened. I'm guessing that's only because of the window class that you used that the (+) sign got carried along.

Thank you, thank you!

fdwojo

P.S. What caused the error, by the way?
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:

fdwojo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 20
  • My CASTLE is my home (and Stana should be, too).
    • View Profile
    • Donate to Member
Re: IDEA: Need an .MPCPL file editor
« Reply #24 on: April 03, 2018, 03:35 PM »
Oh, one more thing. I really like the fact that you provided an INI file, because I really wanted to put the LABEL column to the RIGHT of the FILENAME column, and I CAN!.

I've tested it out on over a dozen (copies) of my MPCPL library, and no problems at all.

Oh, by the way, just for aesthetic purposes, you might want to make the "Save MPC Playlist" line instead say:

"Save MPC Playlist as"

That way it more closely indicates what it does, because the first time I saved it, I worried for a minute... "Is this going to overwrite the original?" But of course, this was only a copy, so it didn't really matter, but for others who didn't have this conversation with you, that reassurance might be a nice confirmation of not overwriting unless they wanted to. And if you wanted to take it all the way, maybe make the CTRL-S key combo work for that? I mention that last because CTRL-O opens an MPCPL file, so CTRL-S would be a perfect match to it.



fdwojo
==================================
No matter where you go, there you are… - B.B. 1984
-------------------------------------------------------
My System: Win 10 Pro 64-bit. Currently updated to version 21H1. RAM: 64GB, CPU: Intel Core i7 6700 CPU @ 4.0 GHz, and if it matters, ~½ TB space left on C:
« Last Edit: April 03, 2018, 03:50 PM by fdwojo »