Index: station.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/station.install,v
retrieving revision 1.9
diff -u -p -r1.9 station.install
--- station.install	10 Aug 2007 17:13:15 -0000	1.9
+++ station.install	29 Oct 2007 19:32:37 -0000
@@ -7,11 +7,8 @@
  * Implementation of hook_uninstall().
  */
 function station_uninstall() {
-  variable_del('station_block_unschedule');
   variable_del('station_remote_archive_url');
   variable_del('station_remote_schedule_url');
-  variable_del('station_stream_high_url');
-  variable_del('station_stream_low_url');
 }
 
 
Index: station.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/station.module,v
retrieving revision 1.32
diff -u -p -r1.32 station.module
--- station.module	27 Aug 2007 22:53:05 -0000	1.32
+++ station.module	29 Oct 2007 19:32:37 -0000
@@ -331,56 +331,6 @@ function station_get_program_at($timesta
   return NULL;
 }
 
-/**
- * Return HTML body of the block listing the current program.
- *
- * @return string
- */
-function station_block_current_program() {
-  // current program
-  $program = station_get_program_at(time(), 0);
-  $unschedule_message = check_plain(variable_get('station_block_unschedule',  t("We're on autopilot.")));
-  $high = check_url(variable_get('station_stream_high_url', ''));
-  $low = check_url(variable_get('station_stream_low_url', ''));
-
-  return theme('station_block_current_program', $program, $unschedule_message, $high, $low);
-}
-
-/**
- * Theme the current program block.
- *
- * @param $program
- *   Program node object.
- * @param $unscheduled_message
- *   message to display if no program is scheduled, i.e. when $program is null
- * @param $high_url
- *   optional, high-bandwidth webstream URL
- * @param $low_url
- *   optional, low-bandwith webstream URL
- * @return string
- */
-function theme_station_block_current_program($program = NULL, $unscheduled_message ='', $high_url = NULL, $low_url = NULL) {
-  // program or unscheduled...
-  if ($program) {
-    $output = l($program->title, $program->node_url) .'<br />';
-  }
-  else {
-    $output = $unscheduled_message .'<br />';
-  }
-
-  // webstream links
-  if ($high_url || $low_url) {
-    $output .= t('Tune in: ');
-    if ($high_url) {
-      $output .= ' '. l(t('High'), $high_url);
-    }
-    if ($low_url) {
-      $output .= ' '. l(t('Low'), $low_url);
-    }
-  }
-
-  return $output;
-}
 
 /**
  * Convert an array to a comma separates list with an add between the last terms.
Index: schedule/station_schedule.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/schedule/station_schedule.install,v
retrieving revision 1.14
diff -u -p -r1.14 station_schedule.install
--- schedule/station_schedule.install	10 Aug 2007 17:13:22 -0000	1.14
+++ schedule/station_schedule.install	29 Oct 2007 19:32:37 -0000
@@ -13,6 +13,8 @@ function station_schedule_install() {
         CREATE TABLE {station_schedule} (
           `nid` int unsigned NOT NULL default '0',
           `increment` int unsigned NOT NULL default '0',
+          `streams` longtext,
+          `unscheduled_message` VARCHAR(255) NOT NULL default '',
           PRIMARY KEY(`nid`)
         ) /*!40100 DEFAULT CHARACTER SET utf8 */;
       ");
@@ -318,4 +320,45 @@ function station_schedule_update_5200() 
 function station_schedule_update_5201() {
   variable_set('station_schedule_redirect_old_urls', 1);
   return array();
-}
\ No newline at end of file
+}
+
+/**
+ * Move the streams from variables into the schedule table.
+ */
+function station_schedule_update_5202() {
+  $ret = array();
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      $ret[] = update_sql("ALTER TABLE {station_schedule} ADD COLUMN `streams` longtext AFTER `increment`");
+      $ret[] = update_sql("ALTER TABLE {station_schedule} ADD COLUMN `unscheduled_message` VARCHAR(255) NOT NULL default '' AFTER `streams`");
+      
+      $streams = array();
+      if ($high = variable_get('station_stream_high_url', '')) {
+        $streams['high'] = array(
+           'name' => t('High'),
+           'description' => t('High bandwidth stream'),
+           'urls' => $high,
+        );
+      }
+      if ($low = variable_get('station_stream_low_url', '')) {
+        $streams['low'] = array(
+          'name' => t('Low'),
+          'description' => t('Low bandwidth stream'),
+          'urls' => $low,
+        );
+      }
+      if (count($streams)) {
+        db_query("UPDATE {station_schedule} SET streams = '%s', unscheduled_message = '%s", serialize($streams), $unscheduled_message);
+      }
+      variable_del('station_stream_high_url');
+      variable_del('station_stream_low_url');
+
+      $unscheduled_message = variable_get('station_block_unschedule',  t("We're on autopilot."));
+      db_query("UPDATE {station_schedule} SET unscheduled_message = '%s'", $unscheduled_message);
+      variable_del('station_block_unschedule');
+
+      break;
+  }
+  return $ret;
+}
Index: schedule/station_schedule.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/schedule/station_schedule.module,v
retrieving revision 1.54
diff -u -p -r1.54 station_schedule.module
--- schedule/station_schedule.module	26 Oct 2007 19:00:14 -0000	1.54
+++ schedule/station_schedule.module	29 Oct 2007 19:32:38 -0000
@@ -67,6 +67,16 @@ function station_schedule_menu($may_cach
       $nid = (int) arg(1);
       $node = node_load($nid);
       if ($node->type == 'station_schedule') {
+        // Stream M3U links
+        foreach ($node->settings['streams'] as $key => $stream) {
+          $items[] = array(
+            'path' => "node/$nid/$key.m3u",
+            'type' => MENU_CALLBACK,
+            'callback' => 'station_schedule_stream_m3u',
+            'callback arguments' => array($stream),
+          );
+        }
+
         $items[] = array(
           'path' => "node/$nid/view/week",
           'title' => t('Week'),
@@ -196,22 +206,119 @@ function station_schedule_form($node) {
     '#options' => array(15 => t('15 Minutes'), 30 => t('30 Minutes'), 60 => t('1 Hour')),
     '#description' => t("This is the minimum increment that programs can be scheduled in. <strong>Caution:</strong> Increasing this value on an existing schedule will probably cause wierdness."),
   );
+  $form['settings']['unscheduled_message'] = array(
+    '#type' => 'textfield',
+    '#title' => t('No scheduled programming message'),
+    '#size' => 60,
+    '#maxlength' => 255,
+    '#description' => t('This string will appear when no program is currently scheduled.'),
+    '#default_value' => $node->settings['unscheduled_message'],
+  );
+  $form['settings']['streams'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Web streams'),
+    '#theme' => 'station_schedule_form_streams',
+    '#collapsible' => TRUE,
+    '#description' => t("If your station has webstreams enter them below."),
+  );
+  if (!isset($node->settings['streams']['new'])) {
+    $node->settings['streams']['new'] = array(
+      'name' => '',
+      'description' => '',
+      'urls' => array(),
+    );
+  }
+  foreach ($node->settings['streams'] as $key => $stream) {
+    $form['settings']['streams'][$key]['name'] = array(
+      '#type' => 'textfield',
+      '#size' => 10,
+      '#default_value' => $stream['name'],
+    );
+    $form['settings']['streams'][$key]['description'] = array(
+      '#type' => 'textfield',
+      '#size' => 20,
+      '#default_value' => $stream['description'],
+    );
+    $form['settings']['streams'][$key]['urls'] = array(
+      '#type' => 'textarea',
+      '#rows' => 2,
+      '#cols' => 20,
+      '#default_value' => implode("\n", $stream['urls']),
+    );
+  }
 
   if ($type->has_body) {
     $form['body_filter']['body'] = array(
       '#type' => 'textarea',
       '#title' => check_plain($type->body_label),
       '#default_value' => $node->body,
-      '#rows' => 10,
+      '#rows' => 6,
       '#required' => ($type->min_word_count > 0),
       '#description' => t("Description of the schedule."),
     );
     $form['body_filter']['format'] = filter_form($node->format);
   }
-
+  
   return $form;
 }
 
+
+function theme_station_schedule_form_streams(&$form) {
+  $header = array(t('Name'), t('Description'), t('URLs'));
+  foreach (element_children($form) as $key) {
+    $row = array();
+    $row[] = drupal_render($form[$key]['name']);
+    $row[] = drupal_render($form[$key]['description']);
+    $row[] = drupal_render($form[$key]['urls']);
+    $rows[] = $row;
+  }
+  $output .= theme('table', $header, $rows);
+  $output .= drupal_render($form);
+
+  return $output;
+}
+
+/**
+ * Implementation of hook_validate().
+ */
+function station_schedule_validate(&$node) {
+  foreach ($node->settings['streams'] as $key => $stream) {
+    // Must have both a name and URL.
+    if (empty($stream['name']) xor empty($stream['urls'])) {
+      if (empty($stream['name'])) {
+        form_set_error("settings][streams][$key][name", t('You must provide a name for the webstream.'));
+      }
+      else {
+        form_set_error("settings][streams][$key][urls", t('You must provide a URL for the webstream.'));
+      }
+    }
+
+    foreach (explode("\n", $stream['urls']) as $url) {
+      $url = trim($url);
+      if (!empty($url) && !valid_url($url, TRUE)) {
+        form_set_error("settings][streams][$key][urls", t('An invalid webstream URL was provided: %url', array('%url' => $url)));
+      }
+    }
+  }
+}
+
+/**
+ * Implementation of hook_submit().
+ */
+function station_schedule_submit(&$node) {
+  $streams = array();
+  foreach ($node->settings['streams'] as $key => $stream) {
+    // Skip empty rows.
+    if (!empty($stream['name'])) {
+      // Convert URLs into an array.
+      $stream['urls'] = array_map('trim', explode("\n", $stream['urls']));
+      $streams[$stream['name']] = $stream;
+    }
+  }
+  $node->settings['streams'] = $streams;
+}
+
+
 /**
  * Implementation of hook_load().
  */
@@ -238,8 +345,17 @@ function station_schedule_load($node) {
     }
   }
 
+  // Load the settings.
+  $settings = db_fetch_array(db_query('SELECT increment, streams, unscheduled_message FROM {station_schedule} WHERE nid = %d', $node->nid));
+  if (isset($settings['streams']) && $streams = unserialize($settings['streams'])) {
+    $settings['streams'] = $streams;
+  }
+  else {
+    $settings['streams'] = array();
+  }
+
   return array(
-    'settings' => db_fetch_array(db_query('SELECT increment FROM {station_schedule} WHERE nid = %d', $node->nid)),
+    'settings' => $settings,
     'schedule' => $schedule,
   );
 }
@@ -248,7 +364,7 @@ function station_schedule_load($node) {
  * Implementation of hook_insert().
  */
 function station_schedule_insert($node) {
-  db_query("INSERT INTO {station_schedule} (nid, increment) VALUES (%d, %d)", $node->nid, $node->settings['increment']);
+  db_query("INSERT INTO {station_schedule} (nid, increment, streams, unscheduled_message) VALUES (%d, %d, '%s', '%s')", $node->nid, $node->settings['increment'], serialize($node->settings['streams']), $node->settings['unscheduled_message']);
 }
 
 /**
@@ -264,7 +380,7 @@ function station_schedule_delete($node) 
  */
 function station_schedule_update($node) {
   db_query("DELETE FROM {station_schedule} WHERE nid = %d", $node->nid);
-  db_query("INSERT INTO {station_schedule} (nid, increment) VALUES (%d, %d)", $node->nid, $node->settings['increment']);
+  db_query("INSERT INTO {station_schedule} (nid, increment, streams, unscheduled_message) VALUES (%d, %d, '%s', '%s')", $node->nid, $node->settings['increment'], serialize($node->settings['streams']), $node->settings['unscheduled_message']);
 }
 
 function station_schedule_admin_settings() {
@@ -771,14 +887,13 @@ function station_schedule_get_program_li
 function station_schedule_program_get_at($gmt_timestamp, $schedule_nid = 0) {
   // Load the schedule item based on the time.
   $ts = station_local_ts($gmt_timestamp);
-  $day = date('w', $ts);
-  $hour = date('G', $ts);
-  $minute = station_minute_from_day_hour($day, $hour);
+  $minute = station_minute_from_day_hour(date('w', $ts), date('G', $ts));
+
   $schedule_nid = (int) ($schedule_nid ? $schedule_nid : variable_get('station_schedule_default', 0));
-  $schedule_item = station_schedule_load_item_at($schedule_nid, $minute);
+  $schedule_item = db_fetch_object(db_query('SELECT * FROM {station_schedule_item} s WHERE s.schedule_nid = %d AND s.start <= %d AND s.finish > %d', $schedule_nid, $minute, $minute));
 
   // If there's an associated program, load it
-  if ($schedule_item->program_nid) {
+  if (isset($schedule_item->program_nid)) {
     if ($node = node_load($schedule_item->program_nid)) {
       // set this so that if the show is scheduled for multiple times the caller
       // can easily figure out which one.
@@ -803,21 +918,6 @@ function station_schedule_load_item($iid
   }
 }
 
-/**
- * Load the schedule by minute of the week.
- * @param $schedule_nid
- *  Schedule id
- * @param $minute
- *  the minute of the week...
- * @return schedule object
- */
-function station_schedule_load_item_at($schedule_nid, $minute) {
-  $result = db_query('SELECT * FROM {station_schedule_item} s WHERE s.schedule_nid = %d AND s.start <= %d AND s.finish > %d', $schedule_nid, $minute, $minute);
-  if ($s = db_fetch_object($result)) {
-    return $s;
-  }
-}
-
 function station_schedule_item_list($node) {
   drupal_add_css(drupal_get_path('module', 'station_schedule') .'/station_schedule.css');
   drupal_set_title(check_plain($node->title));
@@ -1090,50 +1190,74 @@ function station_schedule_item_remove_fo
 function station_schedule_view($node, $teaser = FALSE, $page = FALSE) {
   drupal_add_css(drupal_get_path('module', 'station_schedule') .'/station_schedule.css');
 
-  $header[0] = array('data' => t('Time'));
-  $row = array();
-
-  // First column is hours.
-  $row[0]['id'] = 'station-sch-hours';
-  for ($hour = 0; $hour < 24; $hour++) {
-    $row[0]['data'] .= theme('station_schedule_hour', $hour);
+  if ($page) {
+    $breadcrumb = array();
+    $breadcrumb[] = array('path' => 'station', 'title' => t('Station'));
+    $breadcrumb[] = array('path' => 'station/schedule', 'title' => t('Schedules'));
+    $breadcrumb[] = array('path' => 'node/'. $node->nid);
+    menu_set_location($breadcrumb);
   }
 
-  // Then a column for each day of the week.
-  foreach ($node->schedule as $day => $items) {
-    $header[$day + 1]['data'] = station_day_name($day);
-    $row[$day + 1]['data'] = '';
+  $node = node_prepare($node, $teaser);
+  if ($teaser) {
+    $program = station_schedule_program_get_at(time(), $node->nid);
+    $node->content['current_program'] = array(
+      '#prefix' => t('On Air: '),
+      '#value' => isset($program) ? l($program->title, "node/$program->nid") : check_plain($node->settings['unscheduled_message']),
+      '#suffix' => ' ',
+      '#weight' => -6,
+    );
+    $node->content['streams'] = array(
+      '#title' => t('Webstreams'),
+      '#value' => theme('station_schedule_streams', $node),
+      '#weight' => -5,
+    );
+  }
+  else {
+    $header[0] = array('data' => t('Time'));
+    $row = array();
 
-    // The last finish pointer starts at the beginning of the day.
-    $last_finish = $day * MINUTES_IN_DAY;
-    $day_finish = ($day + 1) * MINUTES_IN_DAY;
-    foreach ($items as $item) {
-      // Display blocks for unscheduled time periods
-      if ($last_finish != $item->start) {
-        $row[$day + 1]['data'] .= theme('station_schedule_spacer', $last_finish, $item->start);
+    // First column is hours.
+    $row[0]['id'] = 'station-sch-hours';
+    for ($hour = 0; $hour < 24; $hour++) {
+      $row[0]['data'] .= theme('station_schedule_hour', $hour);
+    }
+
+    // Then a column for each day of the week.
+    foreach ((array) $node->schedule as $day => $items) {
+      $header[$day + 1]['data'] = station_day_name($day);
+      $row[$day + 1]['data'] = '';
+
+      // The last finish pointer starts at the beginning of the day.
+      $last_finish = $day * MINUTES_IN_DAY;
+      $day_finish = ($day + 1) * MINUTES_IN_DAY;
+      foreach ($items as $item) {
+        // Display blocks for unscheduled time periods
+        if ($last_finish != $item->start) {
+          $row[$day + 1]['data'] .= theme('station_schedule_spacer', $last_finish, $item->start);
+        }
+        $last_finish = $item->finish;
+  
+        // Display the schedule item.
+        $program = node_load($item->program_nid);
+        $row[$day + 1]['data'] .= theme('station_schedule_item', $item->start, $item->finish, $program);
+      }
+      // Display a block for any remaining time during the day.
+      if ($last_finish < $day_finish) {
+        $row[$day + 1]['data'] .= theme('station_schedule_spacer', $last_finish, $day_finish);
       }
-      $last_finish = $item->finish;
-
-      // Display the schedule item.
-      $program = node_load($item->program_nid);
-      $row[$day + 1]['data'] .= theme('station_schedule_item', $item->start, $item->finish, $program);
-    }
-    // Display a block for any remaining time during the day.
-    if ($last_finish < $day_finish) {
-      $row[$day + 1]['data'] .= theme('station_schedule_spacer', $last_finish, $day_finish);
     }
-  }
-
-  // Add a class to indicate what day it is.
-  $today = station_today();
-  $header[$today + 1]['class'] = 'station-sch-now-day';
-  $row[$today + 1]['class'] = 'station-sch-now-day';
 
-  $node = node_prepare($node, $teaser);
-  $node->content['weekly_schedule'] = array(
-    '#value' => theme('table', $header, array($row), array('id' => 'station-sch')),
-    '#weight' => 1,
-  );
+    // Add a class to indicate what day it is.
+    $today = station_today();
+    $header[$today + 1]['class'] = 'station-sch-now-day';
+    $row[$today + 1]['class'] = 'station-sch-now-day';
+
+    $node->content['weekly_schedule'] = array(
+      '#value' => theme('table', $header, array($row), array('id' => 'station-sch')),
+      '#weight' => 1,
+    );
+  }
   return $node;
 }
 
@@ -1170,15 +1294,6 @@ function theme_station_schedule_item($st
   return $output;
 }
 
-
-/**
- * Today's schedule. This is just a short cut for the menu system.
- */
-function station_schedule_today_page($schedule_nid) {
-  $node = node_load($schedule_nid);
-  return station_schedule_day_page($node, station_today());
-}
-
 /**
  * Print a day's schedule page.
  */
@@ -1223,3 +1338,34 @@ function station_schedule_day_page($node
 
   return $output;
 }
+
+/**
+ * Send the client an M3U file of the streams.
+ *
+ * @param $stream An array with a 'urls' item containing an array of webstream
+ *   URLs.
+ */
+function station_schedule_stream_m3u($stream) {
+  drupal_set_header('Content-Type: audio/mpegurl');
+  $output = '';
+  foreach ($stream['urls'] as $url) {
+    $output .= $url ."\n";
+  }
+  print $output;
+  exit();
+}
+
+/**
+ * Theme a station node's web streams.
+ *
+ * @param $node A station schedule node.
+ */
+function theme_station_schedule_streams($node) {
+  if (count($node->settings['streams'])) {
+    $output = t('Tune in: ');
+    foreach ($node->settings['streams'] as $key => $stream) {
+      $output .= l($stream['name'], "node/{$node->nid}/$key.m3u");
+    }
+    return $output;
+  }
+}
Index: schedule/views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/schedule/views.inc,v
retrieving revision 1.12
diff -u -p -r1.12 views.inc
--- schedule/views.inc	14 Sep 2007 18:15:26 -0000	1.12
+++ schedule/views.inc	29 Oct 2007 19:32:38 -0000
@@ -27,7 +27,51 @@ function station_schedule_views_tables()
       ),
     ),
   );
-
+  $tables['station_schedule'] = array(
+    'name' => 'station_schedule',
+    'join' => array(
+      'left' => array(
+        'table' => 'node',
+        'field' => 'nid'
+      ),
+      'right' => array(
+        'field' => 'nid'
+      )
+    ),
+    'fields' => array(
+      'streams' => array(
+        'name' => t('Station Schedule: Web streams'),
+        'help' => t("Web stream links"),
+        'sortable' => FALSE,
+        'handler' => 'station_handler_field_schedule_streams',
+      ),
+    ),
+  );
+  $tables['station_schedule_item_current'] = array(
+    'name' => 'station_schedule_item',
+    'join' => array(
+      'left' => array(
+        'table' => 'station_schedule',
+        'field' => 'nid',
+      ),
+      'right' => array(
+        'field' => 'schedule_nid'
+      ),
+      'extra' => array(
+        'start <= ***CURRENT_STATION_MINUTE***' => NULL,
+        'finish > ***CURRENT_STATION_MINUTE***' => NULL,
+      ),
+    ),
+    'fields' => array(
+      'program_nid' => array(
+        'name' => t('Station Schedule: Current program'),
+        'help' => t("The currently schedule program."),
+        'sortable' => TRUE,
+        'handler' => 'station_handler_field_schedule_current_program',
+        'addlfields' => array('iid', 'start', 'finish'),
+      ),
+    ),
+  );
   $tables['station_schedule_item'] = array(
     'name' => 'station_schedule_item',
     'join' => array(
@@ -41,14 +85,14 @@ function station_schedule_views_tables()
     ),
     'fields' => array(
       'times' => array(
-        'name' => t('Station: Scheduled times'),
+        'name' => t('Station Schedule: Scheduled times'),
         'help' => t("The time a program begins."),
         'sortable' => FALSE,
         'notafield' => TRUE,
         'handler' => 'station_handler_field_schedule_times',
       ),
       'archive_links' => array(
-        'name' => t('Station: Archive listen and RSS links'),
+        'name' => t('Station Schedule: Archive listen and RSS links'),
         'help' => t("Links to both a page and feed for the program's archived audio."),
         'sortable' => FALSE,
         'notafield' => TRUE,
@@ -62,7 +106,7 @@ function station_schedule_views_tables()
         ),
       ),
       'archive_link_page' => array(
-        'name' => t('Station: Archive listen link'),
+        'name' => t('Station Schedule: Archive listen link'),
         'help' => t("Link to the program's archived audio page."),
         'sortable' => FALSE,
         'notafield' => TRUE,
@@ -76,7 +120,7 @@ function station_schedule_views_tables()
         ),
       ),
       'archive_link_rss' => array(
-        'name' => t('Station: Archive RSS link'),
+        'name' => t('Station Schedule: Archive RSS link'),
         'help' => t("Link to the program's archived audio feed."),
         'sortable' => FALSE,
         'notafield' => TRUE,
@@ -111,6 +155,24 @@ function station_schedule_views_tables()
   return $tables;
 }
 
+function station_handler_field_schedule_streams($fieldinfo, $fielddata, $value, $data) {
+  if ($streams = unserialize($data->station_schedule_streams)) {
+    $data->settings['streams'] = $streams;
+    return theme('station_schedule_streams', $data);
+  }
+}
+
+function station_handler_field_schedule_current_program($fieldinfo, $fielddata, $value, $data) {
+  if (isset($data->station_schedule_item_current_program_nid)) {
+    if ($program = node_load($data->station_schedule_item_current_program_nid)) {
+      return l($program->title, "node/$program->nid");
+    }
+  }
+  else {
+    return check_plain(variable_get('station_block_unschedule',  t("We're on autopilot.")));
+  }
+}
+
 function station_handler_field_schedule_times($fieldinfo, $fielddata, $value, $data) {
   if ($program = node_load($data->nid)) {
     $scheduled = array();
Index: schedule/views_defaults.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/schedule/views_defaults.inc,v
retrieving revision 1.12
diff -u -p -r1.12 views_defaults.inc
--- schedule/views_defaults.inc	22 Aug 2007 17:23:30 -0000	1.12
+++ schedule/views_defaults.inc	29 Oct 2007 19:32:38 -0000
@@ -7,6 +7,79 @@
  */
 function station_schedule_views_default_views() {
   $view = new stdClass();
+  $view->name = 'station_schedule_now_playing';
+  $view->description = 'What\'s currently on the schedule(s)';
+  $view->access = array (
+);
+  $view->view_args_php = '';
+  $view->page = FALSE;
+  $view->page_title = 'On Air';
+  $view->page_header = '';
+  $view->page_header_format = '1';
+  $view->page_footer = '';
+  $view->page_footer_format = '1';
+  $view->page_empty = '';
+  $view->page_empty_format = '1';
+  $view->page_type = 'list';
+  $view->url = '';
+  $view->use_pager = TRUE;
+  $view->nodes_per_page = '10';
+  $view->block = TRUE;
+  $view->block_title = 'On Air';
+  $view->block_header = '';
+  $view->block_header_format = '1';
+  $view->block_footer = '';
+  $view->block_footer_format = '1';
+  $view->block_empty = '';
+  $view->block_empty_format = '1';
+  $view->block_type = 'teaser';
+  $view->nodes_per_block = '10';
+  $view->block_more = FALSE;
+  $view->block_use_page_header = FALSE;
+  $view->block_use_page_footer = FALSE;
+  $view->block_use_page_empty = FALSE;
+  $view->sort = array (
+  );
+  $view->argument = array (
+  );
+  $view->field = array (
+    array (
+      'tablename' => 'node',
+      'field' => 'title',
+      'label' => '',
+      'handler' => 'views_handler_field_nodelink',
+      'options' => 'link',
+    ),
+    array (
+      'tablename' => 'station_schedule_item_current',
+      'field' => 'program_nid',
+      'label' => '',
+    ),
+    array (
+      'tablename' => 'station_schedule',
+      'field' => 'streams',
+      'label' => '',
+    ),
+  );
+  $view->filter = array (
+    array (
+      'tablename' => 'node',
+      'field' => 'type',
+      'operator' => 'OR',
+      'options' => '',
+      'value' => array (
+  0 => 'station_schedule',
+),
+    ),
+  );
+  $view->exposed_filter = array (
+  );
+  $view->requires = array(node, station_schedule_item_current, station_schedule);
+  $views[$view->name] = $view;
+  
+  
+  
+  $view = new stdClass();
   $view->name = 'station_scheduled_programs';
   $view->description = 'Scheduled programs';
   $view->access = array (
