From 66fb7971606ff0833b6ae1836e4dc05d83ee0c82 Mon Sep 17 00:00:00 2001 From: Jakob Pfender Date: Thu, 14 Oct 2010 16:36:46 +0200 Subject: documentation for media.erl --- server/media.erl | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/server/media.erl b/server/media.erl index d6adc5b..5eea592 100644 --- a/server/media.erl +++ b/server/media.erl @@ -115,15 +115,11 @@ play(Artist, Title) -> {Port, {exit_status, 0}} -> start_playing(); {Port, {exit_status, S}} -> throw({commandfailed, S}) end. -<<<<<<< HEAD % Of course we need a query to find out what the highest voted track is. % We accomplish this by requesting all the records from the database and then iterate over them, just taking a look at the vote % variable, so it is like a list of integers. In case no tracks were voted for we just take the first track we found and play it. Of course this song is locked afterwards so a different one will be chosen. -======= -%Increase the vote in the database so it will hopefully be played in the future ->>>>>>> 3ab5da8355e114953c154114aa4c0c36b719e92e %votes for a track, i.e. increases its vote count by one. vote(Artist, Title) -> @@ -135,12 +131,7 @@ vote(Artist, Title) -> end, mnesia:transaction(F). -<<<<<<< HEAD %votes against a track, i.e. decreases its vote count by one. -======= -% decrease votes in database - ->>>>>>> 3ab5da8355e114953c154114aa4c0c36b719e92e devote(Artist, Title) -> F = fun() -> [Head|_] = ask(Artist, Title), @@ -150,12 +141,7 @@ devote(Artist, Title) -> end, mnesia:transaction(F). -<<<<<<< HEAD %resets the vote count of selected track to 0 (this is called when the song is played). -======= -% Reset votes to zero in database - ->>>>>>> 3ab5da8355e114953c154114aa4c0c36b719e92e reset_votes(Artist, Title) -> F = fun() -> [Head|_] = ask(Artist, Title), @@ -164,12 +150,7 @@ reset_votes(Artist, Title) -> end, mnesia:transaction(F). -<<<<<<< HEAD %locks a song so it can't be played again or voted for for that time. -======= -% Lock a song - ->>>>>>> 3ab5da8355e114953c154114aa4c0c36b719e92e lock(Artist, Title) -> F = fun() -> [Head|_] = ask(Artist, Title), @@ -178,12 +159,7 @@ lock(Artist, Title) -> end, mnesia:transaction(F). -<<<<<<< HEAD %unlocks a song so it can be played and voted for again. -======= -% Unlock a song... - ->>>>>>> 3ab5da8355e114953c154114aa4c0c36b719e92e unlock(Artist, Title) -> F = fun() -> [Head|_] = ask(Artist, Title), @@ -192,14 +168,8 @@ unlock(Artist, Title) -> end, mnesia:transaction(F). -<<<<<<< HEAD -%locks a song and then waits for a specified amount of time before unlocking it again. -%this is called when the song is played. -======= % Lock a song if it was just played, after a Timeout it will be unlocked automaticly % If all songs are locked, all will be unlocked. - ->>>>>>> 3ab5da8355e114953c154114aa4c0c36b719e92e lock_process(Artist, Title) -> lock(Artist, Title), receive -- cgit v1.2.3