1 //===========================================
2 //  Lumina-DE source code
3 //  Copyright (c) 2015-2017, Ken Moore
4 //  Available under the 3-clause BSD license
5 //  See the LICENSE file for full details
6 //===========================================
7 #include "BaseAnimGroup.h"
8 
9 //Include all the known subclasses here, then add a unique ID for it to the functions at the bottom
10 //#include "SampleAnimation.h"
11 #include "Fireflies.h"
12 #include "Grav.h"
13 #include "SampleAnimation.h"
14 #include "Text.h"
15 #include "ImageSlideshow.h"
16 #include "VideoSlideshow.h"
17 
18 
readSetting(QString variable,QVariant defaultvalue)19 QVariant BaseAnimGroup::readSetting(QString variable, QVariant defaultvalue){
20   return DesktopSettings::instance()->value(DesktopSettings::ScreenSaver,
21 		 	"Animations/"+animPlugin+"/"+variable, defaultvalue);
22 }
23 
24 //==============================
25 //     PLUGIN LOADING/LISTING
26 //==============================
NewAnimation(QString type,QWidget * parent)27 BaseAnimGroup* BaseAnimGroup::NewAnimation(QString type, QWidget *parent){
28   //This is where we place all the known plugin ID's, and load the associated subclass
29   BaseAnimGroup *anim = 0;
30   if(type=="fireflies"){
31     anim = new FirefliesAnimation(parent);
32   }else if(type == "grav") {
33     anim = new GravAnimation(parent);
34   }else if(type == "text") {
35     anim = new TextAnimation(parent);
36   }else if(type == "imageSlideshow") {
37     anim = new ImageAnimation(parent);
38   }else if(type == "videoSlideshow") {
39     anim = new VideoAnimation(parent);
40   }else {
41     //Unknown screensaver, return a blank animation group
42     anim = new BaseAnimGroup(parent);
43   }
44   //tag the animation with the type it is and return it
45   if(anim!=0){ anim->animPlugin = type; }
46   return anim;
47 }
48 
KnownAnimations()49 QStringList BaseAnimGroup::KnownAnimations(){
50   return (QStringList() << "none" << "grav" << "text" << "imageSlideshow" << "videoSlideshow" << "fireflies");
51 }
52