first re-commit.
This commit is contained in:
61
swurl.cpp
Normal file
61
swurl.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/***************************************************************************
|
||||
|
||||
source::worx raDIYo
|
||||
Copyright © 2020-2022 c.holzheuer
|
||||
chris@sourceworx.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <raDIYoglobals.h>
|
||||
#include <swurl.h>
|
||||
|
||||
|
||||
/**
|
||||
* @brief Kontruktor für Stream-Urls aus CSV-Dateien.
|
||||
*
|
||||
* @param srcstrg Quellstring im Format <name>;<link>
|
||||
* @param defvolume Vorgabewert für die Abspiellautstärke dieses Eintrags.
|
||||
*/
|
||||
|
||||
SWUrl::SWUrl( const QString srcstrg, int defvolume )
|
||||
{
|
||||
|
||||
QStringList entry = srcstrg.split( ';');
|
||||
if( entry.size() == 2 )
|
||||
{
|
||||
title = entry.at( 0 );
|
||||
urlText = entry.at( 1 );
|
||||
}
|
||||
if( defvolume < 0 )
|
||||
defvolume = raDIYo::DefaultVolume;
|
||||
volume = defvolume;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief einfacher Konstruktror
|
||||
* @param atitle Der Titel des Eintrags.
|
||||
* @param atext Der Link des Eintrags.
|
||||
*/
|
||||
|
||||
SWUrl::SWUrl( const QString& atitle, const QString& atext )
|
||||
: title( atitle ), urlText( atext )
|
||||
{
|
||||
volume = raDIYo::DefaultVolume;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user