Pepper_42_C++_interfaces
subtitle_listener_samsung.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_CPP_SAMSUNG_SUBTITLE_LISTENER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_SUBTITLE_LISTENER_SAMSUNG_H_
7 
8 #include "ppapi/c/pp_resource.h"
9 #include "ppapi/c/samsung/ppp_media_player_samsung.h"
10 
11 /// @file
12 /// This file defines a <code>SubtitleListener_Samsung</code> type which allows
13 /// plugin to receive events that indicate a subtitle should be displayed at the
14 /// current playback position.
15 namespace pp {
16 
17 class MediaPlayer_Samsung;
18 
19 /// Listener for receiving subtitle updates provided by the player's internal
20 /// subtitle parser. This listener will be notified every time active and
21 /// visible text track contains a subtitle that should be displayed at the
22 /// current playback position.
24  public:
25  virtual ~SubtitleListener_Samsung();
26 
27  /// Event sent when a subtitle should be displayed.
28  ///
29  /// @param[in] duration Duration for which the text should be displayed.
30  /// @param[in] text The UTF-8 encoded string that contains a subtitle text
31  /// that should be displayed. Please note text encoding will be UTF-8
32  /// independently from the source subtitle file encoding.
33  virtual void OnShowSubtitle(PP_TimeDelta duration, const char* text) = 0;
34 
35  protected:
36  /// The default constructor which creates listener not attached
37  /// to the player
39 
40  /// Constructor which creates listener attached to the |player|.
42 
43  /// Attaches listener to the |player|.
44  void AttachTo(MediaPlayer_Samsung* player);
45 
46  private:
47  void Detach();
48  PP_Resource player_;
49 
50  // Disallow copy and assign
52  SubtitleListener_Samsung& operator=(
54 };
55 
56 } // namespace pp
57 
58 #endif // PPAPI_CPP_SAMSUNG_SUBTITLE_LISTENER_SAMSUNG_H_
void AttachTo(MediaPlayer_Samsung *player)
Attaches listener to the |player|.
virtual void OnShowSubtitle(PP_TimeDelta duration, const char *text)=0