make ValueTransfer easier to understand
[LibreOffice.git] / include / avmedia / MediaControlBase.hxx
blob1379a4364f33ed0f536b1ab01ee583731cffde07
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_AVMEDIA_MEDIACONTROLBASE_HXX
20 #define INCLUDED_AVMEDIA_MEDIACONTROLBASE_HXX
22 #include <config_options.h>
23 #include <vcl/weld.hxx>
25 #include <avmedia/avmediadllapi.h>
27 namespace avmedia { class MediaItem; }
29 #define AVMEDIA_TIME_RANGE 2048
31 #define AVMEDIA_ZOOMLEVEL_50 0
32 #define AVMEDIA_ZOOMLEVEL_100 1
33 #define AVMEDIA_ZOOMLEVEL_200 2
34 #define AVMEDIA_ZOOMLEVEL_FIT 3
35 #define AVMEDIA_ZOOMLEVEL_SCALED 4
36 #define AVMEDIA_ZOOMLEVEL_INVALID 65535
38 namespace avmedia {
40 enum class MediaControlStyle
42 SingleLine = 0,
43 MultiLine = 1
46 class UNLESS_MERGELIBS(AVMEDIA_DLLPUBLIC) MediaControlBase
48 public:
49 MediaControlBase();
50 virtual ~MediaControlBase(){};
52 protected:
53 std::unique_ptr<weld::Toolbar> mxPlayToolBox;
54 std::unique_ptr<weld::Scale> mxTimeSlider;
55 std::unique_ptr<weld::Toolbar> mxMuteToolBox;
56 std::unique_ptr<weld::Scale> mxVolumeSlider;
57 std::unique_ptr<weld::ComboBox> mxZoomListBox;
58 std::unique_ptr<weld::Entry> mxTimeEdit;
59 bool mbCurrentlySettingZoom;
61 virtual void InitializeWidgets();
62 virtual void UpdateToolBoxes(const MediaItem& rMediaItem);
63 void UpdateVolumeSlider( MediaItem const & aMediaItem );
64 void UpdateTimeSlider( MediaItem const & aMediaItem );
65 void UpdateTimeField( MediaItem const & aMediaItem, double fTime );
66 void UpdatePlayState(const MediaItem& rMediaItem);
67 void SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem const & aItem, std::string_view rId);
68 void disposeWidgets();
72 #endif
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */