Skip to content

Commit

Permalink
FFmpeg再生ウインドウでプログレスバーが表示されているときに、プログレスバーの部分を左クリックもしくは左ドラッグでシークできるように変更
Browse files Browse the repository at this point in the history
close #4
  • Loading branch information
lithium0003 committed Feb 22, 2017
1 parent 84b2151 commit d9d8822
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ffmodule/ffmodule.cpp
Expand Up @@ -3059,6 +3059,11 @@ namespace ffmodule {
parent->cursor_hidden = false;
}
parent->cursor_last_shown = av_gettime();
if ((evnt.motion.state & SDL_BUTTON_LMASK) && (parent->display_on && evnt.motion.y > parent->screen->GetHight() - 50)) {
frac = (double)evnt.motion.x / parent->screen->GetWidth();
parent->EventOnSeek(frac, true, false);
return 0;
}
if (!(evnt.motion.state & SDL_BUTTON_RMASK))
return 0;
if (parent->pFormatCtx->duration < 0) {
Expand All @@ -3076,6 +3081,13 @@ namespace ffmodule {
case SDL_BUTTON_LEFT:
if (evnt.button.clicks == 2)
parent->ToggleFullscreen();
else {
if (parent->display_on && evnt.button.y > parent->screen->GetHight() - 50) {
frac = (double)evnt.button.x / parent->screen->GetWidth();
parent->EventOnSeek(frac, true, true);
break;
}
}
parent->display_on = !parent->display_on;
break;
case SDL_BUTTON_RIGHT:
Expand Down
1 change: 1 addition & 0 deletions ffmodule/ffmodule.h
Expand Up @@ -252,6 +252,7 @@ namespace ffmodule {
double external_clock; /* external clock base */

double pos_ratio;
bool left_seek;

bool seek_req;
int seek_flags;
Expand Down

0 comments on commit d9d8822

Please sign in to comment.