-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrenderer.h
77 lines (64 loc) · 1.47 KB
/
renderer.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
67
68
69
70
71
72
73
74
75
76
77
#ifndef renderer_h__
#define renderer_h__
#include <windows.h>
#include <GdiPlus.h>
#include <vector>
#include <string>
#include "gen_win7shell.h"
#include "metadata.h"
#include "albumart.h"
#include "lines.h"
using namespace Gdiplus;
class renderer
{
public:
renderer(const sSettings& Settings, MetaData &metadata, const AlbumArt &AA, HWND WinampWnd);
~renderer();
HBITMAP GetThumbnail();
void ClearBackground();
void ClearCustomBackground();
void ThumbnailPopup();
void SetDimensions(int new_w, int new_h);
private:
ULONG_PTR gdiplusToken;
Gdiplus::Image *custom_img;
Gdiplus::Bitmap *background;
const sSettings &m_Settings;
MetaData &m_metadata;
const AlbumArt &m_albumart;
int width, height, m_iconwidth, m_iconheight;
int m_textpause;
HWND m_hwnd;
std::vector<int> m_textpositions;
bool no_icon;
bool fail;
bool scroll_block;
};
// INLINE
inline void renderer::SetDimensions(int new_w, int new_h)
{
width = new_w;
height = new_h;
}
inline void renderer::ClearBackground()
{
if (background)
{
delete background;
background = NULL;
}
}
inline void renderer::ThumbnailPopup()
{
m_textpositions.clear();
m_textpause = 60;
}
inline void renderer::ClearCustomBackground()
{
if (custom_img)
{
delete custom_img;
custom_img = NULL;
}
}
#endif // renderer_h__