clementj
18th July 2008, 18:59
When a filename (name+path) exceeds about 64 characters Pledit.getmetadata does not properly return the data.
This was found after a clean install and is fully reproduceable.
To reproduce:
1. Insert into pledit-normal.xml
<text
id="PLtest"
default="TEST"
x="174" y="4" w="64" h="16"
font="ariel"
align="left"
valign="top"
fontsize="16"
color="font.display"
/>
after
<button
id="pl.misc" ...
2. Modify pledit.m
---------------------------------------------
#include <lib/std.mi>
#include <lib/pldir.mi>
#include "attribs.m"
Global Layout pl_normal;
Global Layout pl_shade;
Global text PLtest;
Global PlEdit PeListener;
Global Group frameGroup;
System.onScriptLoaded() {
initAttribs();
menubar_pe_attrib.onDataChanged();
pl_normal = getScriptGroup().getParentLayout();
PeListener = new PlEdit;
frameGroup = getScriptGroup();
PLtest = frameGroup.findObject("PLtest");
}
PLtest.onLeftButtonUp(int x, int y) {
int ccount = System.getPlaylistLength()-1;
int cIndex = 0;
while (cIndex <= ccount) { // For all tracks
string metadata = PlEdit.getFileName(cindex);
System.debugString("file ["+metadata+"] ",9);
metadata = PlEdit.getMetaData(cindex,"length");
string ctitle = PlEdit.getMetaData(cindex,"title");
System.debugString(" "+integertostring(cindex)+" length ["+metadata+"] "+ctitle,9);
metadata = PlEdit.getMetaData(cindex,"stereo");
System.debugString(" stereo ["+metadata+"] ",9);
cindex = cindex + 1;
}
}
menubar_pe_attrib.onDataChanged() {
.........
---------------------------------------------
3. compile pledit
4. load several music tracks (any format) into the playlist editor. Some should have very short names, and some names longer than 80 character.
5. Click on the word TEST at the bottom of the playlist editor and then examine the resulting wasabi.txt file.
6. You will readily see that long file names do not work, and short ones are AOK.
This was found after a clean install and is fully reproduceable.
To reproduce:
1. Insert into pledit-normal.xml
<text
id="PLtest"
default="TEST"
x="174" y="4" w="64" h="16"
font="ariel"
align="left"
valign="top"
fontsize="16"
color="font.display"
/>
after
<button
id="pl.misc" ...
2. Modify pledit.m
---------------------------------------------
#include <lib/std.mi>
#include <lib/pldir.mi>
#include "attribs.m"
Global Layout pl_normal;
Global Layout pl_shade;
Global text PLtest;
Global PlEdit PeListener;
Global Group frameGroup;
System.onScriptLoaded() {
initAttribs();
menubar_pe_attrib.onDataChanged();
pl_normal = getScriptGroup().getParentLayout();
PeListener = new PlEdit;
frameGroup = getScriptGroup();
PLtest = frameGroup.findObject("PLtest");
}
PLtest.onLeftButtonUp(int x, int y) {
int ccount = System.getPlaylistLength()-1;
int cIndex = 0;
while (cIndex <= ccount) { // For all tracks
string metadata = PlEdit.getFileName(cindex);
System.debugString("file ["+metadata+"] ",9);
metadata = PlEdit.getMetaData(cindex,"length");
string ctitle = PlEdit.getMetaData(cindex,"title");
System.debugString(" "+integertostring(cindex)+" length ["+metadata+"] "+ctitle,9);
metadata = PlEdit.getMetaData(cindex,"stereo");
System.debugString(" stereo ["+metadata+"] ",9);
cindex = cindex + 1;
}
}
menubar_pe_attrib.onDataChanged() {
.........
---------------------------------------------
3. compile pledit
4. load several music tracks (any format) into the playlist editor. Some should have very short names, and some names longer than 80 character.
5. Click on the word TEST at the bottom of the playlist editor and then examine the resulting wasabi.txt file.
6. You will readily see that long file names do not work, and short ones are AOK.