AC_PROG_LIBTOOL
AC_FUNC_MMAP
-VALA_REQUIRED=0.11.2
+VALA_REQUIRED=0.11.6
GSSDP_REQUIRED=0.9.2
GUPNP_REQUIRED=0.13.4
GUPNP_AV_REQUIRED=0.7.0
});
current_version = current_version_temp;
- return current_version < SQLFactory.schema_version.to_int ();
+ return current_version < int.parse (SQLFactory.schema_version);
}
public void fix_schema () throws Error {
public void upgrade (int old_version) {
debug ("Older schema detected. Upgrading...");
- int current_version = SQLFactory.schema_version.to_int ();
+ int current_version = int.parse (SQLFactory.schema_version);
while (old_version < current_version) {
if (this.database != null) {
switch (old_version) {
private void open_db (string name) throws Error {
this.db = new Database (name);
int old_version = -1;
- int current_version = SQLFactory.schema_version.to_int ();
+ int current_version = int.parse (SQLFactory.schema_version);
try {
var upgrader = new MediaCacheUpgrader (this.db, this.sql);
item.title = metadata[Metadata.FILE_NAME];
if (metadata[Metadata.SIZE] != "")
- item.size = metadata[Metadata.SIZE].to_int64 ();
+ item.size = int64.parse (metadata[Metadata.SIZE]);
else
// If its in tracker store and size is unknown, it most probably
// means the size is 0 (i-e a place-holder empty item that we
if (metadata[MusicMetadata.DURATION] != "" &&
metadata[MusicMetadata.DURATION] != "0") {
- music.duration = metadata[MusicMetadata.DURATION].to_int ();
+ music.duration = int.parse (metadata[MusicMetadata.DURATION]);
}
if (metadata[MusicMetadata.SAMPLE_RATE] != "") {
- music.sample_freq = metadata[MusicMetadata.SAMPLE_RATE].to_int ();
+ music.sample_freq = int.parse
+ (metadata[MusicMetadata.SAMPLE_RATE]);
}
if (metadata[MusicMetadata.CHANNELS] != "") {
- music.channels = metadata[MusicMetadata.CHANNELS].to_int ();
+ music.channels = int.parse (metadata[MusicMetadata.CHANNELS]);
}
if (metadata[MusicMetadata.BITS_PER_SAMPLE] != "") {
var bits_per_sample = metadata[MusicMetadata.BITS_PER_SAMPLE];
- music.bits_per_sample = bits_per_sample.to_int ();
+ music.bits_per_sample = int.parse (bits_per_sample);
}
if (metadata[MusicMetadata.BITRATE] != "") {
- music.bitrate = metadata[MusicMetadata.BITRATE].to_int () / 8;
+ music.bitrate = int.parse (metadata[MusicMetadata.BITRATE]) / 8;
}
if (metadata[MusicMetadata.AUDIO_TRACK_NUM] != "") {
var track_number = metadata[MusicMetadata.AUDIO_TRACK_NUM];
- music.track_number = track_number.to_int ();
+ music.track_number = int.parse (track_number);
}
music.artist = metadata[MusicMetadata.AUDIO_ARTIST];
var photo = item as PhotoItem;
if (metadata[PictureMetadata.WIDTH] != "") {
- photo.width = metadata[PictureMetadata.WIDTH].to_int ();
+ photo.width = int.parse (metadata[PictureMetadata.WIDTH]);
}
if (metadata[PictureMetadata.HEIGHT] != "") {
- photo.height = metadata[PictureMetadata.HEIGHT].to_int ();
+ photo.height = int.parse (metadata[PictureMetadata.HEIGHT]);
}
}
}
yield query.execute (this.resources);
- this.child_count = query.result[0,0].to_int ();
+ this.child_count = int.parse (query.result[0,0]);
this.updated ();
} catch (GLib.Error error) {
critical (_("Error getting item count under category '%s': %s"),
var video = item as VideoItem;
if (metadata[VideoMetadata.WIDTH] != "")
- video.width = metadata[VideoMetadata.WIDTH].to_int ();
+ video.width = int.parse (metadata[VideoMetadata.WIDTH]);
if (metadata[VideoMetadata.HEIGHT] != "")
- video.height = metadata[VideoMetadata.HEIGHT].to_int ();
+ video.height = int.parse (metadata[VideoMetadata.HEIGHT]);
if (metadata[VideoMetadata.DURATION] != "")
- video.duration = metadata[VideoMetadata.DURATION].to_int ();
+ video.duration = int.parse (metadata[VideoMetadata.DURATION]);
}
}
protected override string create_filter (string variable, string value) {
var year = this.create_title_for_value (value);
- var next_year = (year.to_int () + 1).to_string ();
+ var next_year = (int.parse (year) + 1).to_string ();
year += "-01-01T00:00:00Z";
next_year += "-01-01T00:00:00Z";
tokens[2] != null &&
tokens[0] == section &&
tokens[1] == key) {
- value = tokens[2].to_int ();
+ value = int.parse (tokens[2]);
if (value >= min && value <= max) {
value_set = true;
}
tokens[1] == key) {
value = new ArrayList<int> ();
foreach (var val_token in tokens[2].split (",", -1)) {
- value.add (val_token.to_int ());
+ value.add (int.parse (val_token));
}
break;
}
tokens[2] != null &&
tokens[0] == section &&
tokens[1] == key) {
- value = tokens[2].to_bool ();
+ value = bool.parse (tokens[2]);
value_set = true;
break;
}
var str = this.get_string (section, key);
var value = new ArrayList<int> ();
foreach (var token in str.split (",", -1)) {
- value.add (token.to_int ());
+ value.add (int.parse (token));
}
return value;
throw new ConfigurationError.NO_VALUE_SET ("No value available");
}
- return val.to_int ().clamp (min, max);
+ return int.parse (val).clamp (min, max);
}
private bool get_bool_variable (string variable) throws GLib.Error {
// Get first byte position
pos = range_tokens[0];
if (pos[0].isdigit ()) {
- start = pos.to_int64 ();
+ start = int64.parse (pos);
} else if (pos != "") {
throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"),
range);
// Get last byte position if specified
pos = range_tokens[1];
if (pos[0].isdigit ()) {
- stop = pos.to_int64 ();
+ stop = int64.parse (pos);
if (stop < start) {
throw new HTTPSeekError.INVALID_RANGE
(_("Invalid Range '%s'"), range);
break;
case "th":
- this.thumbnail_index = parts[i + 1].to_int ();
+ this.thumbnail_index = int.parse (parts[i + 1]);
break;
case "sub":
- this.subtitle_index = parts[i + 1].to_int ();
+ this.subtitle_index = int.parse (parts[i + 1]);
break;
default:
// Get start time
time = range_tokens[0];
if (time[0].isdigit ()) {
- start = (int64) (time.to_double () * SECOND);
+ start = (int64) (double.parse (time) * SECOND);
} else if (time != "") {
throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"),
range);
// Get end time
time = range_tokens[1];
if (time[0].isdigit()) {
- stop = (int64) (time.to_double () * SECOND);
+ stop = (int64) (double.parse (time) * SECOND);
if (stop < start) {
throw new HTTPSeekError.INVALID_RANGE
(_("Invalid Range '%s'"), range);
LogLevel level;
if (tokens.length == 1) {
- level = (LogLevel) tokens[0].to_int ();
+ level = (LogLevel) int.parse (tokens[0]);
domain = "*";
} else {
domain = tokens[0];
- level = (LogLevel) tokens[1].to_int ();
+ level = (LogLevel) int.parse (tokens[1]);
}
var flags = this.log_level_to_flags (level);
}
public bool compare_int (int integer) {
- var operand2 = this.operand2.to_int ();
+ var operand2 = int.parse (this.operand2);
switch (this.op) {
case SearchCriteriaOp.EQ: