A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 73 lines 1.9 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2010 Robert Bieber 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 2 15 * of the License, or (at your option) any later version. 16 * 17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 * KIND, either express or implied. 19 * 20 ****************************************************************************/ 21 22#ifndef RBIMAGE_H 23#define RBIMAGE_H 24 25#include <QPixmap> 26#include <QGraphicsItem> 27 28#include "rbmovable.h" 29 30class ParseTreeNode; 31 32class RBImage: public RBMovable 33{ 34public: 35 RBImage(QString file, int tiles, int x, int y, ParseTreeNode* node, 36 QGraphicsItem* parent = 0); 37 RBImage(const RBImage& other, QGraphicsItem* parent); 38 virtual ~RBImage(); 39 40 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, 41 QWidget *widget); 42 43 void setTile(int tile) 44 { 45 currentTile = tile; 46 if(currentTile > tiles - 1) 47 currentTile = tiles -1; 48 } 49 50 int numTiles() 51 { 52 return tiles; 53 } 54 55 void enableMovement() 56 { 57 setFlag(ItemSendsGeometryChanges, true); 58 } 59 60 61protected: 62 void saveGeometry(); 63 64private: 65 QPixmap* image; 66 int tiles; 67 int currentTile; 68 69 ParseTreeNode* node; 70 71}; 72 73#endif // RBIMAGE_H