diff --git a/Jamulus.pro b/Jamulus.pro index 2165d5f5..5fa7de19 100755 --- a/Jamulus.pro +++ b/Jamulus.pro @@ -174,9 +174,7 @@ HEADERS += src/audiomixerboard.h \ src/recorder/jamrecorder.h \ src/recorder/creaperproject.h \ src/recorder/cwavestream.h \ - src/historygraph.h \ - src/jpeghistorygraph.h \ - src/svghistorygraph.h + src/historygraph.h HEADERS_OPUS = libs/opus/include/opus.h \ libs/opus/include/opus_multistream.h \ diff --git a/src/historygraph.h b/src/historygraph.h index 49f45568..198bcd4b 100644 --- a/src/historygraph.h +++ b/src/historygraph.h @@ -9,11 +9,19 @@ #include "global.h" #include "util.h" +// for CJpegHistoryGraph +#include +#include + +// for CSvgHistoryGraph +#include +#include + /* Definitions ****************************************************************/ // number of history items to store #define NUM_ITEMS_HISTORY 600 -/* Interface ********************************************************************/ +/* Interface ******************************************************************/ class AHistoryGraph { public: @@ -97,4 +105,54 @@ protected: QTimer TimerDailyUpdate; }; +/* Implementations ************************************************************/ +class CJpegHistoryGraph : public QObject, virtual public AHistoryGraph +{ + Q_OBJECT + +public: + CJpegHistoryGraph(); + virtual void Update ( ); + +protected: + virtual void Save ( const QString sFileName ); + + virtual void rect ( const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height ); + virtual void text ( const unsigned int x, const unsigned int y, const QString& value ); + virtual void line ( const unsigned int x1, const unsigned int y1, const unsigned int x2, const unsigned int y2, const unsigned int strokeWidth = 1 ); + virtual void point ( const unsigned int x, const unsigned int y, const unsigned int size, const QString& colour ); + +private: + QImage PlotPixmap; + int iAxisFontWeight; + +public slots: + void OnTimerDailyUpdate() { Update(); } +}; + +class CSvgHistoryGraph : public QObject, virtual public AHistoryGraph +{ + Q_OBJECT + +public: + CSvgHistoryGraph(); + virtual void Update(); + +protected: + virtual void Save ( const QString sFileName ); + + virtual void rect ( const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height ); + virtual void text ( const unsigned int x, const unsigned int y, const QString& value ); + virtual void line ( const unsigned int x1, const unsigned int y1, const unsigned int x2, const unsigned int y2, const unsigned int strokeWidth = 1 ); + virtual void point ( const unsigned int x, const unsigned int y, const unsigned int size, const QString& colour ); + +private: + QXmlStreamAttributes svgRootAttributes; + QString svgImage; + QXmlStreamWriter svgStreamWriter; + +public slots: + void OnTimerDailyUpdate() { Update(); } +}; + #endif // HISTORYGRAPH_H diff --git a/src/jpeghistorygraph.cpp b/src/jpeghistorygraph.cpp index 41b1391f..14dc0d6f 100644 --- a/src/jpeghistorygraph.cpp +++ b/src/jpeghistorygraph.cpp @@ -1,4 +1,4 @@ -#include "jpeghistorygraph.h" +#include "historygraph.h" CJpegHistoryGraph::CJpegHistoryGraph() : AHistoryGraph(), diff --git a/src/jpeghistorygraph.h b/src/jpeghistorygraph.h deleted file mode 100755 index f4dd3c88..00000000 --- a/src/jpeghistorygraph.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef JPEGHISTORYGRAPH_H -#define JPEGHISTORYGRAPH_H - -#include "historygraph.h" - -#include -#include - -/* Classes ********************************************************************/ -class CJpegHistoryGraph : public QObject, virtual public AHistoryGraph -{ - Q_OBJECT - -public: - CJpegHistoryGraph(); - virtual void Update ( ); - -protected: - virtual void Save ( const QString sFileName ); - - virtual void rect ( const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height ); - virtual void text ( const unsigned int x, const unsigned int y, const QString& value ); - virtual void line ( const unsigned int x1, const unsigned int y1, const unsigned int x2, const unsigned int y2, const unsigned int strokeWidth = 1 ); - virtual void point ( const unsigned int x, const unsigned int y, const unsigned int size, const QString& colour ); - -private: - QImage PlotPixmap; - int iAxisFontWeight; - -public slots: - void OnTimerDailyUpdate() { Update(); } -}; - -#endif // JPEGHISTORYGRAPH_H diff --git a/src/serverlogging.h b/src/serverlogging.h index 649bbdd5..a8fb8386 100755 --- a/src/serverlogging.h +++ b/src/serverlogging.h @@ -33,8 +33,7 @@ #include "global.h" #include "util.h" -#include "jpeghistorygraph.h" -#include "svghistorygraph.h" +#include "historygraph.h" /* Classes ********************************************************************/ class CServerLogging diff --git a/src/svghistorygraph.cpp b/src/svghistorygraph.cpp index d5287320..fa364d2a 100755 --- a/src/svghistorygraph.cpp +++ b/src/svghistorygraph.cpp @@ -1,4 +1,4 @@ -#include "svghistorygraph.h" +#include "historygraph.h" CSvgHistoryGraph::CSvgHistoryGraph() : AHistoryGraph(), diff --git a/src/svghistorygraph.h b/src/svghistorygraph.h deleted file mode 100755 index 86ce4f83..00000000 --- a/src/svghistorygraph.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef SVGHISTORYGRAPH_H -#define SVGHISTORYGRAPH_H - -#include "historygraph.h" - -#include -#include - -/* Definitions ****************************************************************/ -// number of history items to store -#ifndef NUM_ITEMS_HISTORY -#define NUM_ITEMS_HISTORY 600 -#endif - -/* Classes ********************************************************************/ -class CSvgHistoryGraph : public QObject, virtual public AHistoryGraph -{ - Q_OBJECT - -public: - CSvgHistoryGraph(); - virtual void Update(); - -protected: - virtual void Save ( const QString sFileName ); - - virtual void rect ( const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height ); - virtual void text ( const unsigned int x, const unsigned int y, const QString& value ); - virtual void line ( const unsigned int x1, const unsigned int y1, const unsigned int x2, const unsigned int y2, const unsigned int strokeWidth = 1 ); - virtual void point ( const unsigned int x, const unsigned int y, const unsigned int size, const QString& colour ); - -private: - QXmlStreamAttributes svgRootAttributes; - QString svgImage; - QXmlStreamWriter svgStreamWriter; - -public slots: - void OnTimerDailyUpdate() { Update(); } -}; - -#endif // SVGHISTORYGRAPH_H