Skip to content
Snippets Groups Projects
Commit effdf580 authored by Canek Peláez Valdés's avatar Canek Peláez Valdés :slight_smile:
Browse files

FileTags: Move band definition to method.

parent f0348f51
Branches
No related tags found
No related merge requests found
......@@ -48,25 +48,7 @@ namespace MLM {
private string _band;
public string band {
get { return _band; }
set {
if (value == "" && _band == null)
return;
Id3Tag.Frame band_frame;
if (value == "") {
band_frame = tag.search_frame(FrameId.BAND);
tag.detachframe(band_frame);
_band = null;
return;
}
if (_band == null) {
band_frame = tag.create_text_frame(FrameId.BAND);
tag.attachframe(band_frame);
} else {
band_frame = tag.search_frame(FrameId.BAND);
}
_band = value;
band_frame.set_text(_band);
}
set { define_band(value); }
}
private string _title;
......@@ -540,6 +522,26 @@ namespace MLM {
}
}
private void define_band(string b) {
if (b == "" && _band == null)
return;
Id3Tag.Frame band_frame;
if (b == "") {
band_frame = tag.search_frame(FrameId.BAND);
tag.detachframe(band_frame);
_band = null;
return;
}
if (_band == null) {
band_frame = tag.create_text_frame(FrameId.BAND);
tag.attachframe(band_frame);
} else {
band_frame = tag.search_frame(FrameId.BAND);
}
_band = b;
band_frame.set_text(_band);
}
~FileTags() {
if (file != null) {
file.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment