   }
 }
 
+void updateVideoIndexDisplay()
+{
+  static uint8_t last_index;
+  if (curr_index == last_index) {
+    return;
+  }
+
+  last_index = curr_index;
+  digitalWrite(SHIFT_REGISTER_LATCH, LOW);
+  shiftOut(SHIFT_REGISTER_DATA, SHIFT_REGISTER_CLOCK, LSBFIRST, last_index - 1);
+  digitalWrite(SHIFT_REGISTER_LATCH, HIGH);
+
+  cout << F("\nUpdated video index display to video number ") << (int16_t)last_index;
+}
+
 void nextFile()
 {
   if (infile->isOpen()) {

  }

  handleQueuedCommands();
  adjustFrameColors();

  unsigned long frame_time = 50 + frame_len * 25UL;


      if (infile->isOpen()) {
        if (!infile->isDir() && !infile->isHidden() && !infile->isSystem()) {
          --curr_index;
#ifdef DEBUG
          char buf[13];
          infile->getName(buf, sizeof(buf));
          cout << F("\nprev opened file ") << (int16_t)curr_index << F(": ") << buf;
#endif
          return;
        }
