diff options
| author | xant <[email protected]> | 2010-12-25 02:05:19 (GMT) |
|---|---|---|
| committer | xant <[email protected]> | 2010-12-25 02:05:19 (GMT) |
| commit | d5509c9917e3abbca75d00f7295ff2fa20e93ed4 (patch) | |
| tree | 821a1444a22bf0a13a914ceb4195a63c38ef539d /jsapi | |
| parent | ac8896e32c88566f602f0a26fcaa8ecd99542cb5 (diff) | |
reviewing javascript base classes after recent changes in the class hierarchy
Diffstat (limited to 'jsapi')
| -rw-r--r-- | jsapi/AudioCapture.js | 6 | ||||
| -rw-r--r-- | jsapi/AudioFile.js (copied from jsapi/core_doc/MovieFile.js) | 35 | ||||
| -rw-r--r-- | jsapi/AudioOutput.js | 8 | ||||
| -rw-r--r-- | jsapi/JMX.js | 8 | ||||
| -rw-r--r-- | jsapi/MovieFile.js (copied from jsapi/core_doc/MovieFile.js) | 14 | ||||
| -rw-r--r-- | jsapi/VideoCapture.js | 8 | ||||
| -rw-r--r-- | jsapi/VideoFilter.js | 4 | ||||
| -rw-r--r-- | jsapi/core_doc/CoreAudioAudioFile.js (renamed from jsapi/core_doc/AudioFile.js) | 8 | ||||
| -rw-r--r-- | jsapi/core_doc/QtMovieFile.js (renamed from jsapi/core_doc/MovieFile.js) | 8 |
9 files changed, 57 insertions, 42 deletions
diff --git a/jsapi/AudioCapture.js b/jsapi/AudioCapture.js index 2b5436b..263ff2d 100644 --- a/jsapi/AudioCapture.js +++ b/jsapi/AudioCapture.js @@ -63,7 +63,7 @@ function AudioCapture(device, type) AudioCapture.availableDevices = function() { ret = new Array(); - QtKitDevices = QtAudioCapture.availableDevices(); + QtKitDevices = QtAudioCapture().availableDevices(); /* TODO - extra implementations */ ret = ret.concat(QtKitDevices); return ret; @@ -76,6 +76,8 @@ AudioCapture.availableDevices = function() AudioCapture.defaultDevice = function() { ret = new Array(); - return QtAudioCapture.defaultDevice(); + ret.concat(QtAudioCapture().availableDevices()); + // add further backends here + return ret; } diff --git a/jsapi/core_doc/MovieFile.js b/jsapi/AudioFile.js index 5c56f1a..63f48d8 100644 --- a/jsapi/core_doc/MovieFile.js +++ b/jsapi/AudioFile.js @@ -4,12 +4,13 @@ */ /** - * MovieFile + * AudioFile * @constructor - * @base VideoEntity - * @class Wrapper class for JMXQtMovieEntity objects. + * @param {String} path The path of the Audio file. + * @base Entity + * @class Abstract class implementing basic functionalities for entities grabbing video frames from Audio files. * Such objects will extract video frames from supported video file types and will provide images on their 'frame' output pin - * Supported file types can be obtained calling the {@link MovieFile#supportedFileTypes} method + * Supported file types can be obtained calling the {@link AudioFile#supportedFileTypes} method * <h3>InputPins:</h3> * <ul> * <li>path {String}</li> @@ -18,22 +19,31 @@ * </ul> * */ -function MovieFile() +function AudioFile(path, type) { + if (!type) { + // TODO implement type selection + return CoreAudioFile(); + } else { + // TODO + } + + /* Documenation Only */ + this.path = ""; this.repeat = false; this.paused = false; - + /** - * Open movie file at specified path + * Open Audio file at specified path * @param {String} path The path of the video file. */ this.open = function(path) { // ... } - + /** - * Close the current movie file (if any) + * Close the current Audio file (if any) */ this.close = function() { // ... @@ -60,7 +70,10 @@ function MovieFile() /** * Returns a list of supported video file types */ -MovieFile.supportedFileTypes = function() { - // ... +AudioFile.supportedFileTypes = function() { + ret = new Array(); + ret = ret.concat(CoreAudioFile().supporterFileTypes()); + /* TODO - add further file-reader implementations */ + return ret; } diff --git a/jsapi/AudioOutput.js b/jsapi/AudioOutput.js index 3c0cc4f..bbb698e 100644 --- a/jsapi/AudioOutput.js +++ b/jsapi/AudioOutput.js @@ -6,9 +6,10 @@ /** * AudioOutput * @constructor + * @param {String} device The device to open. * @param {String} type The specific implementation type, * pass a null value to use the default - * CoreAudio-based implementation + * CoreAudio-based implementation. * @base Entity * @class Send audio samples to an output device * <h3>InputPins:</h3> @@ -21,10 +22,11 @@ * </ul> * */ -function AudioOutput(type) +function AudioOutput(device, type) { if (!type) - return CoreAudioOutput(device); + // TODO - backend-detection using the provided device + return CoreAudioOutput(device); // revert to default backend else echo("Unsupported device type " + type); }
\ No newline at end of file diff --git a/jsapi/JMX.js b/jsapi/JMX.js index a66d55a..535e557 100644 --- a/jsapi/JMX.js +++ b/jsapi/JMX.js @@ -15,10 +15,8 @@ include("AudioOutput.js"); //echo("Registered class: AudioOutput"); include("AudioCapture.js"); //echo("Registered class: AudioCapture"); +include("VideoCapture.js"); +include("MovieFile.js"); +include("AudioFile.js"); -/* -include("QtMovieFile.js"); -include("QtVideoCapture.js"); -include("CoreAudioFile.js"); -*/ //echo("Done initializing JMX Core API");
\ No newline at end of file diff --git a/jsapi/core_doc/MovieFile.js b/jsapi/MovieFile.js index 5c56f1a..da4e778 100644 --- a/jsapi/core_doc/MovieFile.js +++ b/jsapi/MovieFile.js @@ -6,8 +6,9 @@ /** * MovieFile * @constructor + * @param {String} path The path of the movie file. * @base VideoEntity - * @class Wrapper class for JMXQtMovieEntity objects. + * @class Abstract class implementing basic functionalities for entities grabbing video frames from movie files. * Such objects will extract video frames from supported video file types and will provide images on their 'frame' output pin * Supported file types can be obtained calling the {@link MovieFile#supportedFileTypes} method * <h3>InputPins:</h3> @@ -18,12 +19,12 @@ * </ul> * */ -function MovieFile() +function MovieFile(path, type) { this.path = ""; this.repeat = false; this.paused = false; - + /** * Open movie file at specified path * @param {String} path The path of the video file. @@ -31,7 +32,7 @@ function MovieFile() this.open = function(path) { // ... } - + /** * Close the current movie file (if any) */ @@ -61,6 +62,9 @@ function MovieFile() * Returns a list of supported video file types */ MovieFile.supportedFileTypes = function() { - // ... + ret = new Array(); + ret = ret.concat(QtMovieFile().supporterFileTypes()); + /* TODO - add further file-reader implementations */ + return ret; } diff --git a/jsapi/VideoCapture.js b/jsapi/VideoCapture.js index 39a4fe5..20a72fc 100644 --- a/jsapi/VideoCapture.js +++ b/jsapi/VideoCapture.js @@ -63,9 +63,8 @@ function VideoCapture(device, type) VideoCapture.availableDevices = function() { ret = new Array(); - QtKitDevices = QtVideoCapture.availableDevices(); - /* TODO - extra implementations */ - ret = ret.concat(QtKitDevices); + ret = ret.concat(QtVideoCapture().availableDevices()); + /* TODO - add further backends */ return ret; } @@ -75,7 +74,6 @@ VideoCapture.availableDevices = function() */ VideoCapture.defaultDevice = function() { - ret = new Array(); - return QtVideoCapture.defaultDevice(); + return QtVideoCapture().defaultDevice(); } diff --git a/jsapi/VideoFilter.js b/jsapi/VideoFilter.js index bdf8ea2..b408086 100644 --- a/jsapi/VideoFilter.js +++ b/jsapi/VideoFilter.js @@ -56,10 +56,8 @@ VideoFilter.availableFilters = function() { // list filters from all implemented backends // Core Image ret = new Array(); - ciFilter = new CoreImageFilter(); - coreImageFilters = ciFilter.availableFilters(); /* TODO - extra backends */ - ret = ret.concat(coreImageFilters); + ret = ret.concat(CoreImageFilter().availableFilters()); return ret; } diff --git a/jsapi/core_doc/AudioFile.js b/jsapi/core_doc/CoreAudioAudioFile.js index d9440c0..ded681a 100644 --- a/jsapi/core_doc/AudioFile.js +++ b/jsapi/core_doc/CoreAudioAudioFile.js @@ -4,9 +4,9 @@ */ /** - * AudioFile + * CoreAudioFile * @constructor - * @base Entity + * @base AudioFile * @class Read samples from audio files * Supported file types can be obtained calling the {@link AudioFile#supportedFileTypes} method * <h3>InputPins:</h3> @@ -21,7 +21,7 @@ * </ul> * */ -function AudioFile() +function CoreAudioFile() { this.path = ""; this.repeat = false; @@ -60,7 +60,7 @@ function AudioFile() /** * Returns a list of supported audio file types */ -AudioFile.supportedFileTypes = function() { +CoreAudioFile.supportedFileTypes = function() { // ... } diff --git a/jsapi/core_doc/MovieFile.js b/jsapi/core_doc/QtMovieFile.js index 5c56f1a..aea01be 100644 --- a/jsapi/core_doc/MovieFile.js +++ b/jsapi/core_doc/QtMovieFile.js @@ -4,9 +4,9 @@ */ /** - * MovieFile + * QtMovieFile * @constructor - * @base VideoEntity + * @base MovieFile * @class Wrapper class for JMXQtMovieEntity objects. * Such objects will extract video frames from supported video file types and will provide images on their 'frame' output pin * Supported file types can be obtained calling the {@link MovieFile#supportedFileTypes} method @@ -18,7 +18,7 @@ * </ul> * */ -function MovieFile() +function QtMovieFile() { this.path = ""; this.repeat = false; @@ -60,7 +60,7 @@ function MovieFile() /** * Returns a list of supported video file types */ -MovieFile.supportedFileTypes = function() { +QtMovieFile.supportedFileTypes = function() { // ... } |

