[a881f6]: contrib / brl / bbas / vidl2 / examples / vidl2_player_menus.cxx Maximize Restore History

Download this file

vidl2_player_menus.cxx    117 lines (84 with data), 2.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// This is brl/bbas/vidl2/examples/vidl2_player_menus.cxx
#include "vidl2_player_menus.h"
#include "vidl2_player_manager.h"
#include <vgui/vgui.h>
#include <vgui/vgui_key.h>
#include <vgui/vgui_menu.h>
//----- Static menu callback functions -----
void vidl2_player_menus::open_istream_callback()
{
vidl2_player_manager::instance()->open_istream();
}
void vidl2_player_menus::close_istream_callback()
{
vidl2_player_manager::instance()->close_istream();
}
void vidl2_player_menus::open_ostream_callback()
{
vidl2_player_manager::instance()->open_ostream();
}
void vidl2_player_menus::close_ostream_callback()
{
vidl2_player_manager::instance()->close_ostream();
}
void vidl2_player_menus::pipe_streams_callback()
{
vidl2_player_manager::instance()->pipe_streams();
}
void vidl2_player_menus::quit_callback()
{
vidl2_player_manager::instance()->quit();
}
void vidl2_player_menus::pause_video_callback()
{
vidl2_player_manager::instance()->pause_video();
}
void vidl2_player_menus::next_frame_callback()
{
vidl2_player_manager::instance()->next_frame();
}
void vidl2_player_menus::prev_frame_callback()
{
vidl2_player_manager::instance()->prev_frame();
}
void vidl2_player_menus::go_to_frame_callback()
{
vidl2_player_manager::instance()->go_to_frame();
}
void vidl2_player_menus::play_video_callback()
{
vidl2_player_manager::instance()->play_video();
}
void vidl2_player_menus::stop_video_callback()
{
vidl2_player_manager::instance()->stop_video();
}
//----- vidl2_player_menus definition -----
vgui_menu vidl2_player_menus::get_menu()
{
vgui_menu menubar;
vgui_menu menufile;
vgui_menu menuvstream;
vgui_menu menuview;
//file menu entries
menufile.add( "Quit", quit_callback,(vgui_key)'q', vgui_CTRL);
menuvstream.add( "Open Input", open_istream_callback);
menuvstream.add( "Close Input", close_istream_callback);
menuvstream.separator();
menuvstream.add( "Open Output", open_ostream_callback);
menuvstream.add( "Close Output", close_ostream_callback);
menuvstream.separator();
menuvstream.add( "Input to Output", pipe_streams_callback);
//view menu entries
menuview.add( "Play", play_video_callback,(vgui_key)'p', vgui_CTRL);
menuview.add( "Pause", pause_video_callback,(vgui_key)'p');
menuview.add( "Next", next_frame_callback,(vgui_key)'f');
menuview.add( "Prev", prev_frame_callback,(vgui_key)'b');
menuview.add( "Go to Frame", go_to_frame_callback,(vgui_key)'g', vgui_CTRL);
menuview.add( "Stop", stop_video_callback,(vgui_key)'s', vgui_CTRL);
//Top level menu layout
menubar.add( "File", menufile);
menubar.add( "Video Stream", menuvstream);
menubar.add( "View", menuview);
return menubar;
}