LibreOffice Module avmedia (master) 1
MediaControlBase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include <config_options.h>
22#include <vcl/weld.hxx>
23
25
26namespace avmedia { class MediaItem; }
27
28#define AVMEDIA_TIME_RANGE 2048
29
30#define AVMEDIA_ZOOMLEVEL_50 0
31#define AVMEDIA_ZOOMLEVEL_100 1
32#define AVMEDIA_ZOOMLEVEL_200 2
33#define AVMEDIA_ZOOMLEVEL_FIT 3
34#define AVMEDIA_ZOOMLEVEL_SCALED 4
35#define AVMEDIA_ZOOMLEVEL_INVALID 65535
36
37namespace avmedia {
38
40{
41 SingleLine = 0,
42 MultiLine = 1
43};
44
45class UNLESS_MERGELIBS(AVMEDIA_DLLPUBLIC) MediaControlBase
46{
47public:
48 MediaControlBase();
49 virtual ~MediaControlBase(){};
50
51protected:
52 std::unique_ptr<weld::Toolbar> mxPlayToolBox;
53 std::unique_ptr<weld::Scale> mxTimeSlider;
54 std::unique_ptr<weld::Toolbar> mxMuteToolBox;
55 std::unique_ptr<weld::Scale> mxVolumeSlider;
56 std::unique_ptr<weld::ComboBox> mxZoomListBox;
57 std::unique_ptr<weld::Entry> mxTimeEdit;
58 bool mbCurrentlySettingZoom;
59
60 virtual void InitializeWidgets();
61 virtual void UpdateToolBoxes(const MediaItem& rMediaItem);
62 void UpdateVolumeSlider( MediaItem const & aMediaItem );
63 void UpdateTimeSlider( MediaItem const & aMediaItem );
64 void UpdateTimeField( MediaItem const & aMediaItem, double fTime );
65 void UpdatePlayState(const MediaItem& rMediaItem);
66 void SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem const & aItem, std::u16string_view rId);
67 void disposeWidgets();
68};
69
70}
71
72/* vim:set shiftwidth=4 softtabstop=4 expandtab: */