forked from jfchapman/VUPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Handlers.h
67 lines (46 loc) · 1.78 KB
/
Handlers.h
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
#pragma once
#include "Handler.h"
#include <list>
// Audio format handlers
class Handlers
{
public:
Handlers();
virtual ~Handlers();
// Opens a decoder.
// 'filename' - file to open.
// Returns the decoder, or nullptr if the stream could not be opened.
Decoder::Ptr OpenDecoder( const std::wstring& filename ) const;
// Reads 'tags' from 'filename', returning true if the tags were read.
bool GetTags( const std::wstring& filename, Tags& tags ) const;
// Writes 'tags' to 'filename', returning true if the tags were written.
bool SetTags( const std::wstring& filename, const Tags& tags ) const;
// Returns all the file extensions supported by the decoders, as a set of lowercase strings.
std::set<std::wstring> GetAllSupportedFileExtensions() const;
// Returns the BASS library version.
std::wstring GetBassVersion() const;
// Adds a 'handler'.
void AddHandler( Handler::Ptr handler );
// Returns the available encoders.
Handler::List GetEncoders() const;
// Opens a encoder matching the 'description'.
// Returns the encoder, or nullptr if an encoder could not be opened.
Encoder::Ptr OpenEncoder( const std::wstring& description ) const;
// Called when the application 'settings' have changed.
void SettingsChanged( Settings& settings ) const;
// Initialises the handlers with the application 'settings'.
void Init( Settings& settings );
private:
// Returns a decoder handler supported by the 'filename' extension, or nullptr of there was no match.
Handler::Ptr FindDecoderHandler( const std::wstring& filename ) const;
// BASS Handler.
Handler::Ptr m_HandlerBASS;
// FFmpeg handler.
Handler::Ptr m_HandlerFFmpeg;
// Available handlers.
Handler::List m_Handlers;
// Available decoders.
Handler::List m_Decoders;
// Available encoders.
Handler::List m_Encoders;
};