1 /*
2  * Copyright (c) 2017-2020 gnome-mpv
3  *
4  * This file is part of Celluloid.
5  *
6  * Celluloid is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Celluloid is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Celluloid.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef MODEL_H
21 #define MODEL_H
22 
23 #include <glib.h>
24 
25 #include "celluloid-mpv.h"
26 #include "celluloid-player.h"
27 
28 G_BEGIN_DECLS
29 
30 #define CELLULOID_TYPE_MODEL (celluloid_model_get_type())
31 
32 G_DECLARE_FINAL_TYPE(CelluloidModel, celluloid_model, CELLULOID, MODEL, CelluloidPlayer)
33 
34 CelluloidModel *
35 celluloid_model_new(gint64 wid);
36 
37 void
38 celluloid_model_initialize(CelluloidModel *model);
39 
40 void
41 celluloid_model_reset(CelluloidModel *model);
42 
43 void
44 celluloid_model_quit(CelluloidModel *model);
45 
46 void
47 celluloid_model_mouse(CelluloidModel *model, gint x, gint y);
48 
49 void
50 celluloid_model_key_down(CelluloidModel *model, const gchar* keystr);
51 
52 void
53 celluloid_model_key_up(CelluloidModel *model, const gchar* keystr);
54 
55 void
56 celluloid_model_key_press(CelluloidModel *model, const gchar* keystr);
57 
58 void
59 celluloid_model_reset_keys(CelluloidModel *model);
60 
61 void
62 celluloid_model_play(CelluloidModel *model);
63 
64 void
65 celluloid_model_pause(CelluloidModel *model);
66 
67 void
68 celluloid_model_stop(CelluloidModel *model);
69 
70 void
71 celluloid_model_forward(CelluloidModel *model);
72 
73 void
74 celluloid_model_rewind(CelluloidModel *model);
75 
76 void
77 celluloid_model_next_chapter(CelluloidModel *model);
78 
79 void
80 celluloid_model_previous_chapter(CelluloidModel *model);
81 
82 void
83 celluloid_model_next_playlist_entry(CelluloidModel *model);
84 
85 void
86 celluloid_model_previous_playlist_entry(CelluloidModel *model);
87 
88 void
89 celluloid_model_shuffle_playlist(CelluloidModel *model);
90 
91 void
92 celluloid_model_unshuffle_playlist(CelluloidModel *model);
93 
94 void
95 celluloid_model_seek(CelluloidModel *model, gdouble value);
96 
97 void
98 celluloid_model_seek_offset(CelluloidModel *model, gdouble offset);
99 
100 void
101 celluloid_model_load_audio_track(CelluloidModel *model, const gchar *filename);
102 
103 void
104 celluloid_model_load_video_track(CelluloidModel *model, const gchar *filename);
105 
106 void
107 celluloid_model_load_subtitle_track(	CelluloidModel *model,
108 					const gchar *filename );
109 
110 gdouble
111 celluloid_model_get_time_position(CelluloidModel *model);
112 
113 void
114 celluloid_model_set_playlist_position(CelluloidModel *model, gint64 position);
115 
116 void
117 celluloid_model_remove_playlist_entry(CelluloidModel *model, gint64 position);
118 
119 void
120 celluloid_model_move_playlist_entry(	CelluloidModel *model,
121 					gint64 src,
122 					gint64 dst );
123 
124 void
125 celluloid_model_load_file(	CelluloidModel *model,
126 				const gchar *uri,
127 				gboolean append );
128 
129 gboolean
130 celluloid_model_get_use_opengl_cb(CelluloidModel *model);
131 
132 void
133 celluloid_model_initialize_gl(CelluloidModel *model);
134 
135 void
136 celluloid_model_render_frame(CelluloidModel *model, gint width, gint height);
137 
138 void
139 celluloid_model_get_video_geometry(	CelluloidModel *model,
140 					gint64 *width,
141 					gint64 *height );
142 
143 gchar *
144 celluloid_model_get_current_path(CelluloidModel *model);
145 
146 G_END_DECLS
147 
148 #endif
149