Skip to content

Commit c8218a8

Browse files
removed a bunch of debug traces
1 parent ead6353 commit c8218a8

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

src/pman/bg/MediaTools.hx

+9-9
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,24 @@ class MediaTools {
2626
}
2727

2828
class MediaRowTools {
29-
/**
30-
* convert a MediaRow to a Media object
31-
*/
32-
//public static inline function toMedia(row: MediaRow):Media {
33-
//return new Media(MediaSourceTools.toMediaSource( row.uri ), row);
34-
//}
29+
3530
}
3631

3732
@:expose('MediaSourceTools')
3833
class MediaSourceTools {
34+
/**
35+
convert given MediaSource value to a URI string
36+
**/
3937
public static function toUri(src: MediaSource):String {
4038
return (switch ( src ) {
4139
case MSLocalPath( path ): ('file://' + path.toString());
4240
case MSUrl( url ): url;
4341
});
4442
}
4543

44+
/**
45+
convert given MediaSource value to a Media instance
46+
**/
4647
public static inline function toMedia(src: MediaSource):Media {
4748
return new Media( src );
4849
}
@@ -54,8 +55,8 @@ class MediaSourceTools {
5455
@:expose('UriTools2')
5556
class UriTools {
5657
/**
57-
* convert a URI String into a Media instance
58-
*/
58+
convert given Uri to Media instance
59+
**/
5960
public static function toMedia(uri: String):Null<Media> {
6061
uri = uri.toUri();
6162
if (uri != null) {
@@ -105,7 +106,6 @@ class UriTools {
105106
var uri_path:String = uri.toFilePath().toString();
106107
handleFsPath( uri_path );
107108
throw PManError.PMEFileSystemError(EMalformedPathError(uri_path));
108-
//throw 'Error: Malformed FileSystem path "${uri.toFilePath()}"';
109109

110110
default:
111111
return MSUrl( uri );

src/pman/bg/URITools.hx

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class URITools {
128128
var pre:PRegEx = PRegEx.build(function(re: PRegEx) {
129129
return re.anyOf('!*\'();:@&=+$,/?#[]', false, true).or().whitespace();
130130
}).withOptions('g');
131-
trace(pre.toString());
132131
var re:RegEx = pre.toRegEx();
133132
return re.map(text, function(re) {
134133
return ('%' + re.matched(0).charCodeAt(0).hex(2));

src/pman/media/MediaTools.hx

+22-17
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ using pman.bg.MediaTools;
4040
@:expose('MediaTools')
4141
class MediaTools {
4242
/**
43-
* probe the given Directory for all openable files
44-
*/
43+
probe the given Directory for all openable files
44+
**/
4545
public static function getAllOpenableFiles(dir:Directory, done:Array<File>->Void):Void {
4646
var probe = new OpenableFileProbe();
4747
probe.setSources([dir]);
4848
probe.run( done );
4949
}
5050

51+
/**
52+
probe many directories for all contained files that PMan can open
53+
**/
5154
public static function igetAllOpenableFiles(idir:Iterable<Directory>, done:Array<File>->Void):Void {
5255
var coll = new Array();
5356
function collect(d:Directory, next:Void->Void) {
@@ -66,34 +69,33 @@ class MediaTools {
6669
}
6770

6871
/**
69-
* convert the given file list into a track list
70-
*/
72+
convert the given list of File instances into a list of Track instances
73+
**/
7174
public static inline function convertToTracks(files : Array<File>):Array<Track> {
7275
return (new FileListConverter().convert( files ).toArray());
7376
}
7477

7578
/**
76-
* initialize a list of Tracks all at once
77-
*/
79+
initialize a list of Track instances all at once
80+
**/
7881
public static function initAll(tracks:Array<Track>, done:Void->Void):Void {
7982
var initter = new TrackListInitializer();
8083
initter.initAll(tracks, function(count : Int) {
8184
done();
8285
});
8386
}
8487

85-
/**
86-
* load data for a list of Tracks
87-
*/
88+
/*
8889
@:deprecated
8990
public static function loadDataForAll(tracks:Array<Track>, ?done:Cb<TLDLResult>):Void {
9091
var loader = new TrackListDataLoader();
9192
loader.load(tracks, done);
9293
}
94+
*/
9395

94-
/**
95-
* get underlying media object from the given MediaObject
96-
*/
96+
/**
97+
get underlying media object from the given MediaObject
98+
**/
9799
@:access( gryffin.display.Video )
98100
@:access( gryffin.audio.Audio )
99101
public static function getUnderlyingMediaObject(mo : MediaObject):NativeMediaObject {
@@ -108,14 +110,14 @@ class MediaTools {
108110
}
109111
}
110112

111-
/**
112-
* load the MediaMetadata attached to the given MediaSource
113-
*/
113+
/**
114+
load the MediaMetadata attached to the given MediaSource
115+
**/
114116
public static function getMediaMetadata(src:MediaSource):Promise<Null<MediaMetadata>> {
115-
return Promise.create({
117+
return new Promise(function(yes, no) {
116118
switch ( src ) {
117119
case MSLocalPath( path ):
118-
@forward new LoadMediaMetadata( path ).getMetadata();
120+
yes(cast new LoadMediaMetadata( path ).getMetadata());
119121

120122
default:
121123
throw 'Error: Media metadata can only be loaded for media items located on the local filesystem';
@@ -129,6 +131,9 @@ class MediaTools {
129131
public static inline function stripSlashSlash(s : String):String return s.withoutLeadingSlashes();
130132
}
131133

134+
/**
135+
mixins for Uri strings
136+
**/
132137
class UriTools {
133138
//
134139
public static function toMediaProvider(uri: String):MediaProvider {

src/pman/ui/PlaylistView.hx

-4
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ class PlaylistView extends Pane {
140140
player.session.trackChanged.off( on_track_change );
141141
//player.session.playlist.changeEvent.off( on_playlist_change );
142142
unbindQueue( player.session.playlist );
143-
144-
// output to console so I can check if listeners are being properly unbound
145-
echo( player.session.trackChanged );
146-
echo( player.session.playlist.changeEvent );
147143
}
148144

149145
public function bindQueue(q: Playlist):Void {

0 commit comments

Comments
 (0)