diff options
| author | phintuka <phintuka> | 2011-06-19 21:39:51 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-06-19 21:39:51 +0000 |
| commit | dcab414e493d7775987cc7e22969fdb79233990e (patch) | |
| tree | aebf6a1350befa6a7cb3e45e299e83a933731af8 | |
| parent | 24957b8af607cfe19e2e9d31eef4b763acaed55c (diff) | |
| download | xineliboutput-dcab414e493d7775987cc7e22969fdb79233990e.tar.gz xineliboutput-dcab414e493d7775987cc7e22969fdb79233990e.tar.bz2 | |
Added config option for skip behaviour (chapter/title)
| -rw-r--r-- | xine/BluRay/input_bluray.c | 65 |
1 files changed, 40 insertions, 25 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c index d3321728..2b967e77 100644 --- a/xine/BluRay/input_bluray.c +++ b/xine/BluRay/input_bluray.c @@ -671,37 +671,42 @@ static void handle_events(bluray_input_plugin_t *this) case XINE_EVENT_INPUT_NUMBER_9: bd_user_input(this->bdh, pts, BD_VK_9); break; case XINE_EVENT_INPUT_NEXT: { - unsigned chapter = bd_get_current_chapter(this->bdh) + 1; - - lprintf("XINE_EVENT_INPUT_NEXT: next chapter\n"); - - if (chapter >= this->title_info->chapter_count) { - if (this->current_title_idx < this->num_title_idx - 1) { - open_title(this, this->current_title_idx + 1); - stream_reset(this); - } - } else { - bd_seek_chapter(this->bdh, chapter); - update_stream_info(this); - stream_reset(this); + cfg_entry_t* entry = this->class->xine->config->lookup_entry(this->class->xine->config, + "media.bluray.skip_behaviour"); + switch (entry->num_value) { + case 0: /* skip by chapter */ + bd_seek_chapter(this->bdh, bd_get_current_chapter(this->bdh) + 1); + update_stream_info(this); + break; + case 1: /* skip by title */ + if (!this->nav_mode) { + open_title(this, MIN(this->num_title_idx - 1, this->current_title_idx + 1)); + } else { + bd_play_title(this->bdh, MIN(this->num_titles, this->current_title + 1)); + } + break; } + stream_reset(this); break; } case XINE_EVENT_INPUT_PREVIOUS: { - int chapter = bd_get_current_chapter(this->bdh) - 1; - - lprintf("XINE_EVENT_INPUT_PREVIOUS: previous chapter\n"); - - if (chapter < 0 && this->current_title_idx > 0) { - open_title(this, this->current_title_idx - 1); - stream_reset(this); - } else { - chapter = MAX(0, chapter); - bd_seek_chapter(this->bdh, chapter); - update_stream_info(this); - stream_reset(this); + cfg_entry_t* entry = this->class->xine->config->lookup_entry(this->class->xine->config, + "media.bluray.skip_behaviour"); + switch (entry->num_value) { + case 0: /* skip by chapter */ + bd_seek_chapter(this->bdh, MAX(0, ((int)bd_get_current_chapter(this->bdh)) - 1)); + update_stream_info(this); + break; + case 1: /* skip by title */ + if (!this->nav_mode) { + open_title(this, MAX(0, this->current_title_idx - 1)); + } else { + bd_play_title(this->bdh, MAX(1, this->current_title - 1)); + } + break; } + stream_reset(this); break; } @@ -1490,6 +1495,8 @@ static void *bluray_init_plugin (xine_t *xine, void *data) { (void)data; + static char *skip_modes[] = {"skip chapter", "skip title", NULL}; + config_values_t *config = xine->config; bluray_input_class_t *this = (bluray_input_class_t *) calloc(1, sizeof (bluray_input_class_t)); @@ -1552,6 +1559,14 @@ static void *bluray_init_plugin (xine_t *xine, void *data) "control age limit is higher than this limit"), 0, parental_change_cb, this); + /* */ + config->register_enum(config, "media.bluray.skip_behaviour", 0, + skip_modes, + _("unit for the skip action"), + _("You can configure the behaviour when issuing a skip command (using the skip " + "buttons for example)."), + 20, NULL, NULL); + return this; } |
