Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Saving export preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving export preferences



Hi Michael

I think in the below mentioned thread you should find your answers:
http://lists.apple.com/archives/QuickTime-java/2005/May/msg00024.html
the bottomline:
you HAVE to use call doUserDialog on the MovieExporter in order to configure the settings and retreive them as an AtomContainer.


Movie.converToFile(yadda,yadda,yadda,yadda); will NOT do.


HTH Cheers, Thomas ---------------------------- Thomas Martin Moersbergerstrasse 7 CH 4057 Basel Switzerland M +41 76 558 67 90 email@hidden http://www.thomas-martin.ch ----------------------------




On Jul 18, 2005, at 20:52, Michael Bøcker-Larsen wrote:


Hi,

I'm writing and application in which a part is to export a batch of music files into a different bitrate and lenght.

I have learned that QTJ 6.3 should have support for setting the export settings programmatically, but that no one really knows how to do it. A work around is to make a GUI application chose a file to export set the settings you want, and then save these settings into a binary file. This file can then be loaded in later so that you don't have to select the export settings again.

This approach has not worked for me. I've have written of files for different settings but if you open them up (using a hex editor) they are identical.

Have anyone successfully saved the export preferences from the MovieExporter and later retrieved them? Even better have anyone figured out set the preferences programmatically?

Bellow are some snippets from my code. These first method is where the AtomContainer is extracted from the MovieExporter, saved as a binary, and later retrieve again.

private AtomContainer loadSettings(String path) throws FileNotFoundException, IOException, QTException {
File settingsFile = new File(path);
byte[] settingsBytes = new byte[(int)settingsFile.length()];
FileInputStream istream = new FileInputStream(settingsFile);
istream.read(settingsBytes);
QTHandle settingsHandle = new QTHandle(settingsBytes);
return AtomContainer.fromQTHandle(settingsHandle);
}


private void saveSettings(MovieExporter anExporter, path) throws FileNotFoundException, IOException, QTException {
AtomContainer container = anExporter.getExportSettingsFromAtomContainer();
FileOutputStream ostream = new FileOutputStream(new File (path));
ostream.write(container.getBytes());
}



--- The part where I export using the GUI the first time

// Export with GUI
movie.convertToFile (null,
saveFile,
StdQTConstants.kQTFileTypeMovie,
StdQTConstants.kMoviePlayer,
IOConstants.smSystemScript,
StdQTConstants.movieToFileOnlyExport | StdQTConstants.showUserSettingsDialog | StdQTConstants.movieFileSpecValid,
exporter);
saveSettings(exporter);



--- The part where I export using the saved settings

// Load settings
exporter.setExportSettingsFromAtomContainer(loadSettings ("/Users/mblarsen/Desktop/Atoms/192.atom"));
// Export with atom
movie.convertToFile (null,
saveFile,
StdQTConstants.kQTFileTypeMovie,
StdQTConstants.kMoviePlayer,
IOConstants.smSystemScript,
StdQTConstants.movieToFileOnlyExport | StdQTConstants.movieFileSpecValid,
exporter);


Best regards

  Michael


_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40obinary.com


This email sent to email@hidden




_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Saving export preferences (From: Michael Bøcker-Larsen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.