int32_t num_played;
/** New last played count. */
int64_t last_played;
- /** new lyrics id. */
+ /** New lyrics id. */
int32_t lyrics_id;
- /** new image id. */
+ /** New image id. */
int32_t image_id;
- /** command line flags (see \ref touch_flags). */
+ /** New amplification value. */
+ int32_t amp;
+ /** Command line flags (see \ref touch_flags). */
unsigned flags;
};
struct osl_object obj;
struct afs_info old_afsi, new_afsi;
int ret, no_options = tad->cto->num_played < 0 && tad->cto->last_played < 0 &&
- tad->cto->lyrics_id < 0 && tad->cto->image_id < 0;
+ tad->cto->lyrics_id < 0 && tad->cto->image_id < 0 && tad->cto->amp < 0;
struct afsi_change_event_data aced;
ret = get_afsi_object_of_row(row, &obj);
new_afsi.num_played = tad->cto->num_played;
if (tad->cto->last_played >= 0)
new_afsi.last_played = tad->cto->last_played;
+ new_afsi.amp = tad->cto->amp;
}
tad->num_matches++;
save_afsi(&new_afsi, &obj); /* in-place update */
.num_played = -1,
.last_played = -1,
.lyrics_id = -1,
- .image_id = -1
+ .image_id = -1,
+ .amp = -1,
};
struct osl_object query = {.data = &cto, .size = sizeof(cto)};
int i, ret;
return ret;
continue;
}
+ if (!strncmp(arg, "-a", 2)) {
+ int32_t val;
+ ret = para_atoi32(arg + 2, &val);
+ if (ret < 0)
+ return ret;
+ if (val < 0 || val > 255)
+ return -ERRNO_TO_PARA_ERROR(EINVAL);
+ cto.amp = val;
+ continue;
+ }
if (!strcmp(arg, "-p")) {
cto.flags |= TOUCH_FLAG_FNM_PATHNAME;
continue;