"Fossies" - the Fresh Open Source Software Archive

Member "audacious-plugins-3.10.1/src/qtui/info_bar.h" (26 Dec 2018, 1927 Bytes) of package /linux/misc/audacious-plugins-3.10.1.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "info_bar.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.8.2_vs_3.9.

    1 /*
    2  * info_bar.h
    3  * Copyright 2014 William Pitcock
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions are met:
    7  *
    8  * 1. Redistributions of source code must retain the above copyright notice,
    9  *    this list of conditions, and the following disclaimer.
   10  *
   11  * 2. Redistributions in binary form must reproduce the above copyright notice,
   12  *    this list of conditions, and the following disclaimer in the documentation
   13  *    provided with the distribution.
   14  *
   15  * This software is provided "as is" and without any warranty, express or
   16  * implied. In no event shall the authors be liable for any damages arising from
   17  * the use of this software.
   18  */
   19 
   20 #ifndef INFO_BAR_H
   21 #define INFO_BAR_H
   22 
   23 #include <QStaticText>
   24 #include <QWidget>
   25 
   26 #include <libaudcore/hook.h>
   27 
   28 class InfoVis;
   29 struct PixelSizes;
   30 
   31 class InfoBar : public QWidget
   32 {
   33 public:
   34     InfoBar (QWidget * parent = nullptr);
   35 
   36     void resizeEvent (QResizeEvent *);
   37     void paintEvent (QPaintEvent *);
   38 
   39 private:
   40     void update_title ();
   41     void update_album_art ();
   42     void next_song ();
   43     void do_fade ();
   44 
   45     void playback_ready_cb ();
   46     void playback_stop_cb ();
   47     void update_vis ();
   48 
   49     const HookReceiver<InfoBar>
   50      hook1 {"tuple change", this, & InfoBar::update_title},
   51      hook2 {"playback ready", this, & InfoBar::playback_ready_cb},
   52      hook3 {"playback stop", this, & InfoBar::playback_stop_cb},
   53      hook4 {"qtui toggle infoarea_vis", this, & InfoBar::update_vis};
   54 
   55     const Timer<InfoBar>
   56      fade_timer {TimerRate::Hz30, this, & InfoBar::do_fade};
   57 
   58     InfoVis * m_vis;
   59     const PixelSizes & ps;
   60 
   61     struct SongData {
   62         QPixmap art;
   63         QString orig_title;
   64         QStaticText title, artist, album;
   65         int alpha;
   66     };
   67 
   68     enum {Prev = 0, Cur = 1}; /* index into SongData array */
   69 
   70     SongData sd[2];
   71     bool m_stopped;
   72 };
   73 
   74 #endif