summaryrefslogtreecommitdiffstats
path: root/macosx/ChapterTitles.m
Commit message (Collapse)AuthorAgeFilesLines
* MacGUI: Varius warnings fixes:ritsuka2013-10-251-1/+1
| | | | | | | | | | - NSUInteger and NSInteger instead of int (where the Cocoa 64bit api uses them). - Cast to int when needed because NSInteger on 64bit is defined as long. - NSURL instead of NSString when possible. - Replaced some deprecated methods/functions. - numberWithInteger instead of numberWithInt. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5854 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGUI: fixed a number of leaks/null-deferences/dead-code found by clang ↵ritsuka2013-10-151-2/+2
| | | | | | static analyzer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5838 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: fix UI lockup when adding a chapter with a name containing non-UTF8 ↵Rodeo2013-07-221-1/+2
| | | | | | characters. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5657 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: refactor handling on chapter titles.Rodeo2013-05-111-46/+43
| | | | | | | | job->list_chapters is reset by any call to hb_job_reset(), so store chapter titles in an NSArray instead. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5451 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve management of titles and jobsjstebbins2012-11-121-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up several several unavoidable memory leaks caused by old api. Clearly separates titles from jobs. Titles are set during scan and never modified now. Since titles are immutable, this lead to API some changes. For example, We were setting chapter names in the title from the front ends. Now these get set in the job. These new APIs allow us to start moving away from our use of title->job. Eventually, I would like to eliminate title->job completely, but the mac ui is too tightly tied to using this field to allow removing it at this time. So there is temporarily a convenience function used only by the mac ui that allows it to continue using title->job and also use the new APIs. New APIs: typedef struct hb_title_set_s hb_title_set_t; struct hb_title_set_s { hb_list_t * list_title; int feature; // Detected DVD feature title }; hb_title_set_t * hb_get_title_set( hb_handle_t * ); This is just something I added to clean up how "feature title" info is passed. hb_job_t * hb_job_init( hb_title_t * title ); Initializes a new job with default settings from the title. hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index ); Same as hb_job_init(). For use by win Interop lib. void hb_job_reset( hb_job_t * job ); Convenience function for the MacUi. Clears audio, subtitle, and filter lists. The macui still uses title->job because it is so intricately tied to it. So I created this convenience function that it can call after adding a job. void hb_job_close( hb_job_t ** job ); Releases the job an all resources it contains. void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts ); Makes a copy of "advanced_opts" and stores in job. Freed by hb_job_close(). void hb_job_set_file( hb_job_t *job, const char *file ); Makes a copy of "file" and stores in job. Freed by hb_job_close(). void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); Makes a copy of "title" and stores in chapter. Freed by hb_chapter_close(). Recommended usage (cli and lingui are updated to do this): job = hb_job_init( title ); // set job settings ... hb_add(h, job); hb_job_close( &job ); I have also added new APIs for managing metadata. These are used to add metadata to a job. void hb_metadata_set_name( hb_metadata_t *metadata, const char *name ); void hb_metadata_set_artist( hb_metadata_t *metadata, const char *artist ); void hb_metadata_set_composer( hb_metadata_t *metadata, const char *composer ); void hb_metadata_set_release_date( hb_metadata_t *metadata, const char *release_date ); void hb_metadata_set_comment( hb_metadata_t *metadata, const char *comment ); void hb_metadata_set_genre( hb_metadata_t *metadata, const char *genre ); void hb_metadata_set_album( hb_metadata_t *metadata, const char *album ); void hb_metadata_set_coverart( hb_metadata_t *metadata, const uint8_t *coverart, int size ); Example: job = hb_job_init( &job ); // set job settings ... hb_metadata_set_artist( job->metadata, "Danny Elfman" ); hb_add(h, job); hb_job_close( &job ); Some APIs have changed in order to avoid using title incorrectly and use the new hb_title_set_t. -void hb_autopassthru_apply_settings( hb_job_t * job, hb_title_t * title ); +void hb_autopassthru_apply_settings( hb_job_t * job ); -void hb_get_preview( hb_handle_t *, hb_title_t *, int, uint8_t * ); +void hb_get_preview( hb_handle_t *, hb_job_t *, int, uint8_t * ); hb_thread_t * hb_scan_init( hb_handle_t *, volatile int * die, const char * path, int title_index, - hb_list_t * list_title, int preview_count, + hb_title_set_t * title_set, int preview_count, int store_previews, uint64_t min_duration ); These APIs have been removed. Win Interop will need some changes. I think what I've provided will be suffecient, but let me know if it's not. -void hb_get_preview_by_index( hb_handle_t *, int, int, uint8_t * ); -void hb_set_anamorphic_size_by_index( hb_handle_t *, int, - int *output_width, int *output_height, - int *output_par_width, int *output_par_height ); git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5058 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui; fixed warnings related to 64bit cocoa.ritsuka2009-03-011-4/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2183 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: Fixed the warning in ChapterTitles for real this time.ritsuka2008-08-081-5/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1618 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: Fixed a warning.ritsuka2008-08-051-3/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1609 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui; Fixed a crash when the chapters tableview is selected and a new ↵ritsuka2008-07-231-14/+20
| | | | | | | | source is being opened. Some whitespace cleaning too. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1574 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGUI: Implements a part of the NSTableView delegate in ChapterTitles so ↵ritsuka2008-06-041-0/+35
| | | | | | that pressing Return selects the next row and edits the chapter title so that the mouse or Mac OS X's full keyboard access is not required. Patch by bkiico517. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1492 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: replace handbrake.m0k.org references with handbrake.fr in the entire ↵dynaflash2008-04-151-1/+1
| | | | | | macosx/ directory git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1419 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: Fix issue where selecting the chapter tab can crash the macgui if no ↵dynaflash2008-01-221-1/+6
| | | | | | | | valid source is selected - patch by travistex git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1222 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix Previous Bad commit for Cyanders Chapter Markersdynaflash2007-04-251-0/+99
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@548 b64f7644-9d1e-0410-96f1-a4d463321fa5