mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 17:18:11 -04:00
added check for readOnly in save methods
This commit is contained in:
parent
868ce3dd21
commit
eec5e33e0d
@ -21,6 +21,7 @@
|
||||
|
||||
#include "tstringlist.h"
|
||||
#include "itfile.h"
|
||||
#include "tdebug.h"
|
||||
#include "modfileprivate.h"
|
||||
|
||||
using namespace TagLib;
|
||||
@ -76,6 +77,11 @@ IT::Properties *IT::File::audioProperties() const
|
||||
|
||||
bool IT::File::save()
|
||||
{
|
||||
if(readOnly())
|
||||
{
|
||||
debug("IT::File::save() - Cannot save to a read only file.");
|
||||
return false;
|
||||
}
|
||||
seek(4);
|
||||
writeString(d->tag.title(), 26);
|
||||
// TODO: write comment as instrument and sample names
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "modfile.h"
|
||||
#include "tstringlist.h"
|
||||
#include "tdebug.h"
|
||||
#include "modfileprivate.h"
|
||||
|
||||
using namespace TagLib;
|
||||
@ -71,6 +72,11 @@ Mod::Properties *Mod::File::audioProperties() const
|
||||
|
||||
bool Mod::File::save()
|
||||
{
|
||||
if(readOnly())
|
||||
{
|
||||
debug("Mod::File::save() - Cannot save to a read only file.");
|
||||
return false;
|
||||
}
|
||||
seek(0);
|
||||
writeString(d->tag.title(), 20, ' ');
|
||||
// TODO: write comment as instrument names
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "s3mfile.h"
|
||||
#include "tstringlist.h"
|
||||
#include "tdebug.h"
|
||||
#include "modfileprivate.h"
|
||||
|
||||
using namespace TagLib;
|
||||
@ -71,6 +72,11 @@ S3M::Properties *S3M::File::audioProperties() const
|
||||
|
||||
bool S3M::File::save()
|
||||
{
|
||||
if(readOnly())
|
||||
{
|
||||
debug("S3M::File::save() - Cannot save to a read only file.");
|
||||
return false;
|
||||
}
|
||||
// note: if title starts with "Extended Module: "
|
||||
// the file would look like an .xm file
|
||||
seek(0);
|
||||
|
@ -20,6 +20,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "tstringlist.h"
|
||||
#include "tdebug.h"
|
||||
#include "xmfile.h"
|
||||
#include "modfileprivate.h"
|
||||
|
||||
@ -73,6 +74,11 @@ XM::Properties *XM::File::audioProperties() const
|
||||
|
||||
bool XM::File::save()
|
||||
{
|
||||
if(readOnly())
|
||||
{
|
||||
debug("XM::File::save() - Cannot save to a read only file.");
|
||||
return false;
|
||||
}
|
||||
seek(17);
|
||||
writeString(d->tag.title(), 20);
|
||||
seek(1, Current);
|
||||
|
Loading…
x
Reference in New Issue
Block a user